mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-15 22:44:41 +00:00
9b4d20db90
In the IR built from DWARF, a variadic variadic parameter has an empty type. Later during type comparison, comparing an empty (NULL) type with other types proves to be troublesome. This patch handles the issue by creating a new kind of abigail::type_decl type specifically for variadic parameters. This is like what is done for void types. After that it appears that the categorizing sub-system flags a change of variadic type to non-variadic type as redundant if that change appears several times on different functions. We don't want that because it can hide important changes we want to see. The patch fixes that too. * include/abg-fwd.h (is_array_type): New overload for a naked pointer. * include/abg-ir.h (type_decl::get_variadic_parameter_type_decl): Declare new static function. * src/abg-ir.cc (is_array_type): Define new function overload for naked pointers (type_decl::get_variadic_parameter_type_decl): Define new static function. * src/abg-dwarf-reader.cc (build_function_decl): The type of variadic parameter is now a special type_decl. * include/abg-comparison.h (is_diff_of_variadic_parameter_type) (is_diff_of_variadic_parameter): New function declarations. * src/abg-comparison.cc (is_diff_of_variadic_parameter_type) (is_diff_of_variadic_parameter): Define new functions. (compute_diff): Refuse to return a NULL diff for types. Assert that the parameters are non-NULL. (report_size_and_alignment_changes): We are comparing arrays only if the two parameters are arrays. (fn_parm_diff::fn_parm_diff): Refuse that type diff for this diff node is non empty. (fn_parm_diff::report): Strengthen an assert. Cleanup a comment. (redundancy_marking_visitor::visit_begin): Do not mark function type and variadic parms diff nodes as redundant for local changes. * tests/data/test-diff-dwarf/libtest26-added-parms-before-variadic-v{0,1}.so: New test input binaries. * tests/data/test-diff-dwarf/test26-added-parms-before-variadic-report.txt: New test output reference. * tests/data/test-diff-dwarf/test26-added-parms-before-variadic-v{0,1}.c: Source code of the new test input binaries above. * tests/data/Makefile.am: Add the new test stuff to source distribution. * tests/test-diff-dwarf.cc (in_out_specs): Add the new test inputs above to the set of input to run this test harness over. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
47 lines
542 B
C
47 lines
542 B
C
/* gcc -g -Wall -shared -o libtest26-added-parms-before-variadic-v1.so test26-added-parms-before-variadic-v1.c */
|
|
void
|
|
fun1(const char* c, const char* c1, ...)
|
|
{
|
|
if (c)
|
|
c++;
|
|
|
|
if (c1)
|
|
c1++;
|
|
}
|
|
|
|
void
|
|
fun2(const char* c, const char* c1, ...)
|
|
{
|
|
if (c)
|
|
c++;
|
|
|
|
if (c1)
|
|
c1++;
|
|
}
|
|
|
|
void
|
|
fun3(const char* c, const int* d, const int* d1, ...)
|
|
{
|
|
if (c)
|
|
c++;
|
|
|
|
if (d)
|
|
d++;
|
|
|
|
if (d1)
|
|
d1++;
|
|
}
|
|
|
|
void
|
|
fun4(const char* c, const int* d, const int* d1, ...)
|
|
{
|
|
if (c)
|
|
c++;
|
|
|
|
if (d)
|
|
d++;
|
|
|
|
if (d1)
|
|
d1++;
|
|
}
|