dwarf-reader: fix recursion in expr_result::operator&
authorMatthias Maennich via libabigail <libabigail@sourceware.org>
Mon, 15 Apr 2019 17:05:22 +0000 (18:05 +0100)
committerDodji Seketeli <dodji@redhat.com>
Tue, 16 Apr 2019 14:11:02 +0000 (16:11 +0200)
operator& was implemented in terms of itself, leading to infinite
recursion. Fix that by implementing it in terms of &='ing the const
value. That is consistent with all other ?= operators.

 * src/abg-dwarf-reader.cc: fix expr_result::operator&

Signed-off-by: Matthias Maennich <maennich@google.com>
src/abg-dwarf-reader.cc

index be0f6cf..93f10e7 100644 (file)
@@ -2626,7 +2626,7 @@ public:
   operator&(const expr_result& o)
   {
     expr_result r(*this);
-    r.const_value_ = *this & o;
+    r.const_value_ &= o.const_value_;
     r.is_const_ = r.is_const_ && o.is_const_;
     return r;
   }