mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-08 01:31:37 +00:00
When two decl_base ojects are compared, there are both fast and slow paths to the name comparison. The latter is roughly equivalent to comparing names after applying the regex s/(__anonymous_(?:struct|union|enum)__)\d+/\1/g to the names before comparing them while the former is a straight string comparison with some tweaks for detecting anonymous types. The slow path is taken care of by the helper function tools_utils::decl_names_equal but unfortunately, there is a missing negation of the returned bool. This commit fixes this and updates the few affected tests. Rather than just adding a '!', this commit replaces the negative decls_are_different with a positive decls_are_same. I spent far too long staring at the code before I spotted the mistake and having positively-named things improves readability. The same helper function is also called by has_harmless_name_change and that should be reviewed as well. * src/abg-ir.cc (equals): In the decl_base overload, note that the value returned by decl_names_equal should be negated and replace decls_are_different with decls_are_same, negating all occurrences. * tests/data/test-diff-dwarf/PR25058-liblttng-ctl-report-1.txt: Update tests, removing some spurious anonymous union name change. * tests/data/test-diff-filter/test33-report-0.txt: Diff now completely empty. * tests/data/test-diff-pkg/elfutils-libs-0.170-4.el7.x86_64-multiple-sym-vers-report-0.txt: 3 functions previously considered to have harmless changes are now deemed to have no changes. * tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt: 1 struct RedStore data member previously considered to have harmless changes is now deemed to have no changes. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: One instance of an anonymous struct removed and a typedef repointed at another existing instance; many type ids renumbered. Signed-off-by: Giuliano Procida <gprocida@google.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
data | ||
lib | ||
.gitignore | ||
Makefile.am | ||
mockfedabipkgdiff.in | ||
print-diff-tree.cc | ||
runtestcanonicalizetypes.sh.in | ||
runtestdefaultsupprs.py.in | ||
runtestdefaultsupprspy3.sh.in | ||
runtestfedabipkgdiff.py.in | ||
runtestfedabipkgdiffpy3.sh.in | ||
test-abicompat.cc | ||
test-abidiff-exit.cc | ||
test-abidiff.cc | ||
test-alt-dwarf-file.cc | ||
test-annotate.cc | ||
test-core-diff.cc | ||
test-cxx-compat.cc | ||
test-diff2.cc | ||
test-diff-dwarf-abixml.cc | ||
test-diff-dwarf.cc | ||
test-diff-filter.cc | ||
test-diff-pkg.cc | ||
test-diff-suppr.cc | ||
test-dot.cc | ||
test-elf-helpers.cc | ||
test-ini.cc | ||
test-ir-walker.cc | ||
test-kmi-whitelist.cc | ||
test-lookup-syms.cc | ||
test-read-dwarf.cc | ||
test-read-write.cc | ||
test-svg.cc | ||
test-symtab.cc | ||
test-tools-utils.cc | ||
test-types-stability.cc | ||
test-utils.cc | ||
test-utils.h | ||
test-valgrind-suppressions.supp | ||
test-write-read-archive.cc | ||
update-test-output.py |