mirror of
git://sourceware.org/git/libabigail.git
synced 2025-03-03 13:17:35 +00:00
During type DIE canonicalization, libabigail performs an optimization while comparing two types defined in the same translation unit. That is, inside a given translation unit two pointers that point to a type named T (that is, two T*) are considered equal. They are considered equal without having to structurally compare the two types named T. This generally makes sense, because if two types of the same kind, defined in the same translation unit, have the same name then we can safely conclude that they are actually the same type. Unless the two T are anonymous structs. If the two T are anonymous structs defined in the same translation unit, we really need to compare them structurally to know if they are equal or not. This is what this patch does. * src/abg-dwarf-reader.cc (pointer_or_qual_die_of_anonymous_class_type) (die_is_qualified_type): Define new functions. (compare_dies): If pointers, reference or qualified type have an anonymous struct as their underlying type, then we need to structurally compare the underlying anonymous struct. * tests/data/test-diff-dwarf/libtest43-PR22913-v{0,1}.so: New binary test input files. * tests/data/test-diff-dwarf/test43-PR22913-report-0.txt: New reference output of the comparison of the two binaries above. * tests/data/test-diff-dwarf/test43-PR22913-v{0,1}.c: Source code of the binaries above. * tests/test-diff-dwarf.cc (in_out_specs): Make the test harness compare the two binaries above. * tests/data/Makefile.am: Add the new test files above to the source distribution. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
18 lines
167 B
C
18 lines
167 B
C
typedef struct
|
|
{
|
|
char m0;
|
|
} * Struct0Ptr;
|
|
|
|
char
|
|
f0(Struct0Ptr s)
|
|
{return s->m0;}
|
|
|
|
typedef struct
|
|
{
|
|
char m1;
|
|
} * Struct1Ptr;
|
|
|
|
char
|
|
f1(Struct1Ptr s)
|
|
{return s->m1;}
|