]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Let a tracker do negative caching in dwarf_comparator.
authorRoland McGrath <roland@redhat.com>
Fri, 16 Oct 2009 03:50:34 +0000 (20:50 -0700)
committerRoland McGrath <roland@redhat.com>
Fri, 16 Oct 2009 03:50:34 +0000 (20:50 -0700)
libdw/ChangeLog
libdw/c++/dwarf_comparator

index 9fd6794edf5072568826b5069399124c6a60edd0..c8bbab65d493542dea12420bb8dcdb27bc808da7 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-15  Roland McGrath  <roland@redhat.com>
+
+       * c++/dwarf_comparator (dwarf_comparator::reference_match):
+       Don't bail out before calling tracker's notice_match on mismatches.
+
 2009-10-02  Roland McGrath  <roland@redhat.com>
 
        * c++/subr.hh (subr::stackish): New template type.
index b9bf317f02819f5a7e87526d8118c9c78a55aa07..1fe062c8c383e75dad68268d4bd5b821beda3a46 100644 (file)
@@ -517,10 +517,12 @@ namespace elfutils
       const typename tracker::right_context_type &rhs
        = _m_tracker.right_context (ref2);
 
+      bool result = true;
+
       /* First do the cheap mismatch check on the contexts, then check the
         contents and contexts in ascending order of costliness of a check.  */
       if (_m_tracker.context_quick_mismatch (lhs, rhs))
-       return nomatch (a, b, "quick context");
+       result = nomatch (a, b, "quick context");
 
       /* To compare the children, we have to clone the tracker and use a
         new one, in case of any reference attributes in their subtrees.
@@ -533,19 +535,14 @@ namespace elfutils
       typename tracker::subtracker t (_m_tracker, matched, lhs, rhs);
       subcomparator cmp (t);
 
-      if (!cmp.equals (a.attributes (), b.attributes ()))
-       return nomatch (a, b, "attribute");
+      if (result && !cmp.equals (a.attributes (), b.attributes ()))
+       result = nomatch (a, b, "attribute");
 
-      if (!_m_tracker.context_match (lhs, rhs))
-       return nomatch (a, b, "context");
+      if (result && !_m_tracker.context_match (lhs, rhs))
+       result = nomatch (a, b, "context");
 
-      bool result = !has_children;
-      if (has_children)
-       {
-         result = cmp.equals (a.children (), b.children ());
-         if (!result)
-           result = nomatch (a, b, "children");
-       }
+      if (result && has_children && !cmp.equals (a.children (), b.children ()))
+       result = nomatch (a, b, "children");
 
       // Let the tracker cache a result for its reference_matched.
       return _m_tracker.notice_match (matched, ref1, ref2, result);