diff options
| author | Roland McGrath <[email protected]> | 2005-10-28 06:56:24 +0000 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2005-10-28 06:56:24 +0000 |
| commit | 07d4f2fc1cb53f170a71bc13617bbdd9cb1c3c60 (patch) | |
| tree | 0cd998a48772a7857dc187899cb5bb1f8decc35b /libdw/dwarf_getsrc_die.c | |
| parent | 89757447dbcd0ac946db345fa6aa1edc76a37a11 (diff) | |
libdw/
Fixes to last changes.
tests/
2005-10-27 Roland McGrath <[email protected]>
* run-find-prologues.sh: New file.
* Makefile.am (TESTS, EXTRA_DIST): Add it.
Diffstat (limited to 'libdw/dwarf_getsrc_die.c')
| -rw-r--r-- | libdw/dwarf_getsrc_die.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libdw/dwarf_getsrc_die.c b/libdw/dwarf_getsrc_die.c index e3ce4f2a..753d48f7 100644 --- a/libdw/dwarf_getsrc_die.c +++ b/libdw/dwarf_getsrc_die.c @@ -36,7 +36,7 @@ dwarf_getsrc_die (Dwarf_Die *cudie, Dwarf_Addr addr) size_t idx = (l + u) / 2; if (addr < lines->info[idx].addr) u = idx; - else if (addr > lines->info[idx].addr) + else if (addr > lines->info[idx].addr || lines->info[idx].end_sequence) l = idx + 1; else return &lines->info[idx]; @@ -51,7 +51,12 @@ dwarf_getsrc_die (Dwarf_Die *cudie, Dwarf_Addr addr) information is faulty and no end-sequence marker is present, we still ignore it. */ if (u > 0 && u < nlines && addr > lines->info[u - 1].addr) - return &lines->info[u - 1]; + { + while (lines->info[u - 1].end_sequence && u > 0) + --u; + if (u > 0) + return &lines->info[u - 1]; + } __libdw_seterrno (DWARF_E_ADDR_OUTOFRANGE); return NULL; |
