]> sourceware.org Git - libabigail.git/commit
dwarf-reader: Fix DWARF string comparison optimization
authorDodji Seketeli <dodji@redhat.com>
Mon, 11 Apr 2022 14:12:04 +0000 (16:12 +0200)
committerDodji Seketeli <dodji@redhat.com>
Mon, 20 Jun 2022 16:04:05 +0000 (18:04 +0200)
commit0529e3b9ee09c29137952b3a5d4a7cc10484649a
tree58d09b16f0c5b2d973dda4cde84f140a311a555e
parent7ecef6361799326b99129a479b43b138f0b237ae
dwarf-reader: Fix DWARF string comparison optimization

This fix has been triggered by a fix posted by Thomas Schwinge in the
thread that started at https://sourceware.org/pipermail/libabigail/2022q1/004139.html.

Thomas rightfully notes that compare_dies_string_attribute_value is
wrong.  In some cases, it wrongly considers only the first character
of the two strings to compare.

This patch fixes that and updates the regression tests accordingly.
The fix suppresses several spurious changes (in runtestdifffilter)
that were there and I never got the bottom of them.  Now they are
gone.

* src/abg-dwarf-reader.cc (slowly_compare_strings)
(die_char_str_attribute): Define new static functions.
(compare_dies_string_attribute_value): Use the new
slowly_compare_strings here.
* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
* tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi: Likewise.
* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc
tests/data/test-annotate/test15-pr18892.so.abi
tests/data/test-annotate/test17-pr19027.so.abi
tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi
tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi
tests/data/test-read-dwarf/test-libandroid.so.abi
tests/data/test-read-dwarf/test15-pr18892.so.abi
tests/data/test-read-dwarf/test17-pr19027.so.abi
tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi
tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi
This page took 0.034782 seconds and 5 git commands to generate.