[1/3,applied] Bug 29857 - Don't pop comparison operands that haven't been pushed

Message ID 87sfhbe2u1.fsf@seketeli.org
State New
Headers
Series Bug 29857 - Fix comparing binary with decl-only unions & cycles |

Commit Message

Dodji Seketeli Dec. 19, 2022, 5:11 p.m. UTC
  Hello,

While looking at bug
https://sourceware.org/bugzilla/show_bug.cgi?id=29857, I noticed a
crash that is happening due to the fact that the equal overload for
classes tries pop comparison operands that haven't been pushed to the
stack of comparison operands.  Oops.  Fixed thus.

	* src/abg-ir.cc (equals): In the overload for class_or_union,
	don't try to pop, operands that haven't been pushed.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-ir.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 2719954e..4b375c1a 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -22042,7 +22042,7 @@  equals(const class_or_union& l, const class_or_union& r, change_kind* k)
       if (!val)
 	if (k)
 	  *k |= LOCAL_TYPE_CHANGE_KIND;
-      RETURN(val);
+      ABG_RETURN(val);
     }
 
   // No need to go further if the classes have different names or