[Bug other/69050] libbacktrace: bsearch over unsorted array in unit_addrs_search
ian at airs dot com
gcc-bugzilla@gcc.gnu.org
Sat Dec 26 05:11:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69050
--- Comment #1 from Ian Lance Taylor <ian at airs dot com> ---
The algorithms aren't unrelated. unit_addrs_compare sorts by low then high
then lineoff. unit_addrs_search returns any entry that includes the PC for
which we are searching, where it includes the PC if it is between low and high.
As the comment says, dwarf_fileline (the only caller) then moves forward to
the last range that includes PC. This will return a consistent answer if
low/high ranges are always subsets or supersets--that is, if a->low <= b->low,
then a->high >= b->high. That is always the case for DWARF.
If you are encountering a problem, please describe it in more detail.
More information about the Gcc-bugs
mailing list