]> sourceware.org Git - libabigail.git/commit
Use pointers not strings in type graph comparison.
authorGiuliano Procida <gprocida@google.com>
Fri, 19 Jun 2020 16:39:24 +0000 (17:39 +0100)
committerDodji Seketeli <dodji@redhat.com>
Thu, 9 Jul 2020 08:02:53 +0000 (10:02 +0200)
commit8e8e0778f2b78457f057226d598c2ec569aeb8d2
tree62c00f72c25d2b730aa8e24260cb5b3dfb8242d4
parentb0f98180e00300afbc6d6e9d95824f944c42e03d
Use pointers not strings in type graph comparison.

During structural comparison of types there is the possibilitiy of
infinite recursion as types can have self-references and there can
be more elaborate mutual references between them.

The current comparison algorithm keeps track of currently seen (struct
and function) types by name. This causes earlier caching of names than
is needed and, more significantly, may result in types comparing equal
unexpectedly. This commit switches to storing their addresses instead.

This change affects some tests which show more diffs than previously.

src/abg-ir.cc: (environment::priv): Change types of
classes_being_compared_ and fn_types_being_compared_ to be
simple sets of pointers.
(function_type::priv::mark_as_being_compared): Just add
address to set.
(function_type::priv::unmark_as_being_compared): Just remove
address from set.
(function_type::priv::comparison_started): Just look up
address in set.
(class_or_union::priv::mark_as_being_compared): Just add
address to set.
(class_or_union::priv::unmark_as_being_compared): Just remove
address from set.
(class_or_union::priv::comparison_started): Just look up
address in set.
* tests/data/test-diff-dwarf/PR25058-liblttng-ctl-report-1.txt:
Update.
* tests/data/test-diff-pkg/elfutils-libs-0.170-4.el7.x86_64-multiple-sym-vers-report-0.txt:
Update.
* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt:
Update.
* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt:
Update.

Signed-off-by: Giuliano Procida <gprocida@google.com>
src/abg-ir.cc
tests/data/test-diff-dwarf/PR25058-liblttng-ctl-report-1.txt
tests/data/test-diff-pkg/elfutils-libs-0.170-4.el7.x86_64-multiple-sym-vers-report-0.txt
tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt
tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-3.txt
This page took 0.033804 seconds and 5 git commands to generate.