public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, applied] Bug 29901 - abidiff hangs when comparing libgs.so.10 with itself
@ 2022-12-20 15:35 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2022-12-20 15:35 UTC (permalink / raw)
  To: libabigail

Hello,

This is a follow-up patch to this one:
    88c6e080 Bug 29857 - Better detect comparison cycles in type graph

When looking at the type comparison stack, it looks like a type that
is on the left-hand side of the comparison can appear on the
right-hand side later, in the comparison stack.  The cycle detection
algorithm doesn't take that scenario into account and so that cycle in
the graph of types being compared is not detected.

This patch takes that case into account.

	* src/abg-ir-priv.h (environment::priv::comparison_started): Look
	for each operand of the comparison in both the right-hand and
	left-hand operand stacks.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to the master branch of the git repository.
---
 src/abg-ir-priv.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/abg-ir-priv.h b/src/abg-ir-priv.h
index ae6fabd7..b216c957 100644
--- a/src/abg-ir-priv.h
+++ b/src/abg-ir-priv.h
@@ -1246,8 +1246,9 @@ struct class_or_union::priv
     const environment& env = first.get_environment();
 
     return (env.priv_->left_classes_being_compared_.count(&first)
-	    ||
-	    env.priv_->right_classes_being_compared_.count(&second));
+	    || env.priv_->right_classes_being_compared_.count(&second)
+	    || env.priv_->right_classes_being_compared_.count(&first)
+	    || env.priv_->left_classes_being_compared_.count(&second));
   }
 
   /// Test if a pair of class_or_union is being currently compared.
-- 
2.31.1


-- 
		Dodji


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-20 15:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-20 15:35 [PATCH, applied] Bug 29901 - abidiff hangs when comparing libgs.so.10 with itself Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).