dwarf: fix logic error in eh_frame_hdry binary search

This commit is contained in:
kcbanner 2023-07-02 02:57:35 -04:00
parent 6a5e2b713f
commit 395ab474eb

View File

@ -1886,10 +1886,13 @@ pub const ExceptionFrameHeader = struct {
.data_rel_base = eh_frame_hdr_ptr,
}, builtin.cpu.arch.endian()) orelse return badDwarf();
if (pc >= pc_begin) left = mid;
if (pc == pc_begin) break;
len /= 2;
if (pc < pc_begin) {
len /= 2;
} else {
left = mid;
if (pc == pc_begin) break;
len -= len / 2;
}
}
try stream.seekTo(left * entry_size);