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.
{
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);