]> sourceware.org Git - systemtap.git/commitdiff
dwflpp.cxx: check addr returned by lower_bound()
authorJonathan Lebon <jlebon@redhat.com>
Sun, 1 Jun 2014 19:58:48 +0000 (15:58 -0400)
committerJonathan Lebon <jlebon@redhat.com>
Mon, 2 Jun 2014 13:07:41 +0000 (09:07 -0400)
This is a follow-up to commit 71b8e66. The lower_bound() function
returns an iterator to the first addr which does not compare less than
the entrypc. This means that the returned addr is either equal or
greater than the entrypc (depending on whether the latter is in the
vector).

This patch simply checks that the addr returned by lower_bound() is
equal, not just greater or equal.

dwflpp.cxx

index 67a63c40918099507475129b2fd6d429001d43b1..bea415357e229444d14322f2527d707381377d56 100644 (file)
@@ -2273,7 +2273,7 @@ dwflpp::resolve_prologue_endings (func_info_map_t & funcs)
       {
         vector<Dwarf_Addr>::const_iterator it_addr =
           lower_bound(addrs.begin(), addrs.end(), entrypc);
-        if (it_addr != addrs.end())
+        if (it_addr != addrs.end() && *it_addr == entrypc)
           {
             entrypc_srcline_idx = it_addr - addrs.begin();
             entrypc_srcline = dwarf_onesrcline(lines, entrypc_srcline_idx);
This page took 0.033648 seconds and 5 git commands to generate.