From d1968cea69459801eadeb2de63c85820c22335fd Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 25 Sep 2009 14:57:15 -0700 Subject: [PATCH] Compare a single location so it matches a one-element full-range location list. --- libdw/ChangeLog | 3 +++ libdw/c++/dwarf | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libdw/ChangeLog b/libdw/ChangeLog index c6a576c7a..7c5e03997 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,5 +1,8 @@ 2009-09-25 Roland McGrath + * 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. diff --git a/libdw/c++/dwarf b/libdw/c++/dwarf index 05c4af4e1..3f7210e03 100644 --- a/libdw/c++/dwarf +++ b/libdw/c++/dwarf @@ -1574,11 +1574,11 @@ namespace elfutils || std::find_if (other.begin (), other.end (), nonempty () ) == 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 inline bool operator!= (const other_file &other) const -- 2.47.3