]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Compare a single location so it matches a one-element full-range location list.
authorRoland McGrath <roland@redhat.com>
Fri, 25 Sep 2009 21:57:15 +0000 (14:57 -0700)
committerRoland McGrath <roland@redhat.com>
Fri, 25 Sep 2009 21:57:15 +0000 (14:57 -0700)
libdw/ChangeLog
libdw/c++/dwarf

index c6a576c7a93ff48aea94c3c056512a91712aa518..7c5e039971e8ffc8f73c1fef411026165f172afd 100644 (file)
@@ -1,5 +1,8 @@
 2009-09-25  Roland McGrath  <roland@redhat.com>
 
+       * c++/dwarf (dwarf::location_attr::operator==): Compare a singleton as
+       a list so it matches a one-element full-range list.
+
        * c++/values.cc (dwarf::range_list::const_iterator::const_iterator):
        For begin case, actually get the offset from the attribute!
        (dwarf::location_attr::begin): Likewise.
index 05c4af4e1602f4bc2d5f7bb06b5ca8fd9454c9d5..3f7210e03921fb74fe5c257d192737e727d247b6 100644 (file)
@@ -1574,11 +1574,11 @@ namespace elfutils
                  || std::find_if (other.begin (), other.end (),
                                   nonempty<typename other_attr::value_type> ()
                                   ) == other.end ());
-       if (!is_list ())
-         return (!other.is_list () && !other.empty ()
-                 && location () == other.location ());
 
-       return other.is_list () && subr::container_equal (*this, other);
+       if (!is_list () && !other.is_list ())
+         return !other.empty () && location () == other.location ();
+
+       return subr::container_equal (*this, other);
       }
       template<typename other_file>
       inline bool operator!= (const other_file &other) const