From: Dodji Seketeli Date: Tue, 20 Dec 2022 15:06:33 +0000 (+0100) Subject: Bug 29901 - abidiff hangs when comparing libgs.so.10 with itself X-Git-Tag: upstream/2.3~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1aadfa576963f2baddc6b6bf17898a86e3a041e;p=platform%2Fupstream%2Flibabigail.git Bug 29901 - abidiff hangs when comparing libgs.so.10 with itself 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 --- 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.