diff options
author | Alon Zakai <azakai@google.com> | 2020-09-02 11:23:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 11:23:01 -0700 |
commit | 89020a0b4074d18c3fedd0aec2b2aa900c538a1d (patch) | |
tree | ab2a24601efefd0695c180027e78ff503faf4f0c /src/wasm2js.h | |
parent | ef7ab77b598885a88ca8eb5cc3b8485c3da84db9 (diff) | |
download | binaryen-89020a0b4074d18c3fedd0aec2b2aa900c538a1d.tar.gz binaryen-89020a0b4074d18c3fedd0aec2b2aa900c538a1d.tar.bz2 binaryen-89020a0b4074d18c3fedd0aec2b2aa900c538a1d.zip |
StackCheck: Check both under and overflow (#3091)
See emscripten-core/emscripten#9039 (comment)
The valid stack area is a region [A, B] in memory. Previously we just checked that
new stack positions S were S >= A, which prevented us from growing too much
(the stack grows down). But that only worked if the growth was small enough to not
overflow and become a big unsigned value. This PR makes us check the other way
too, which requires us to know where the stack starts out at.
This still supports the old way of just passing in the growth limit. We can remove it
after the roll.
In principle this can all be done on the LLVM side too after emscripten-core/emscripten#12057
but I'm not sure of the details there, and this is easy to fix here and get testing up
(which can help with later LLVM work).
This helps emscripten-core/emscripten#11860 by allowing us to clean up
some fastcomp-specific stuff in tests.
Diffstat (limited to 'src/wasm2js.h')
0 files changed, 0 insertions, 0 deletions