diff options
author | Alon Zakai <azakai@google.com> | 2024-07-12 13:37:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-12 13:37:40 -0700 |
commit | 0e0e08db6280dec4f4fcce2dff3ba07445c45b8a (patch) | |
tree | c97e58534072cac88bcc685dda3dff49b1cbd20f /src/passes/Print.cpp | |
parent | c0286b61a0eedde936ce1adff4284859ce4c6510 (diff) | |
download | binaryen-0e0e08db6280dec4f4fcce2dff3ba07445c45b8a.tar.gz binaryen-0e0e08db6280dec4f4fcce2dff3ba07445c45b8a.tar.bz2 binaryen-0e0e08db6280dec4f4fcce2dff3ba07445c45b8a.zip |
SafeHeap: Handle overflows when adding the pointer and the size (#6409)
E.g. loading 4 bytes from 2^32 - 2 should error: 2 bytes are past the maximum
address. Before this PR we added 2^32 - 2 + 4 and overflowed to 2, which we
saw as a low and safe address. This PR adds an extra check for an overflow in
that add.
Also add unreachables after calls to segfault(), which reduces the overhead of
the extra check here (the unreachable apparently allows VMs to see that
control flow ends, after the segfault() which is truly no-return).
Fixes emscripten-core/emscripten#21557
Diffstat (limited to 'src/passes/Print.cpp')
0 files changed, 0 insertions, 0 deletions