aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorJohn Schmidt <john.schmidt.h@gmail.com>2022-01-22 22:52:27 +0100
committerJakub Konka <kubkon@jakubkonka.com>2022-01-31 23:55:19 +0100
commit8e497eb32c90fdb40ea31bc968b3f4de02f91c1b (patch)
tree65c7aeb03f3d39608f30901b4633162114ab3892 /src/Module.zig
parent2913950ca9deea6cbbbfea6f4592db366961c428 (diff)
downloadzig-8e497eb32c90fdb40ea31bc968b3f4de02f91c1b.tar.gz
zig-8e497eb32c90fdb40ea31bc968b3f4de02f91c1b.zip
debug: fix edge cases in macOS debug symbol lookup
This commit fixes two related things: 1. If the loop goes all the way through the slice without a match, on the last iteration `mid == symbols.len - 1` which causes `&symbols[mid + 1]` to be out of bounds. End one step before that instead. 2. If the address we're looking for is greater than the address of the last symbol in the slice, we now match it to that symbol. Previously, we would miss this case since we only matched if the address was _in between_ the address of two symbols.
Diffstat (limited to 'src/Module.zig')
0 files changed, 0 insertions, 0 deletions