diff options
author | Derek Schuff <dschuff@chromium.org> | 2018-01-04 16:23:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-04 16:23:11 -0800 |
commit | 4c55e497d7455f6bbda2567f5535b89de7ce7c69 (patch) | |
tree | ab70e8c2faae554ee67233f7a9bd681fc74507e5 /test/llvm_autogenerated/non-executable-stack.wast | |
parent | bbcb50de8d60158067913e27908f43593c8c23c4 (diff) | |
download | binaryen-4c55e497d7455f6bbda2567f5535b89de7ce7c69.tar.gz binaryen-4c55e497d7455f6bbda2567f5535b89de7ce7c69.tar.bz2 binaryen-4c55e497d7455f6bbda2567f5535b89de7ce7c69.zip |
Fix stackAlloc runtime function generation for wasm backend (#1348)
It was returning the top of the allocated space rather than the bottom.
Fix taken from @tbfleming in kripken/emscripten#5974
Diffstat (limited to 'test/llvm_autogenerated/non-executable-stack.wast')
-rw-r--r-- | test/llvm_autogenerated/non-executable-stack.wast | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/test/llvm_autogenerated/non-executable-stack.wast b/test/llvm_autogenerated/non-executable-stack.wast index e6ed0e88b..fff883f57 100644 --- a/test/llvm_autogenerated/non-executable-stack.wast +++ b/test/llvm_autogenerated/non-executable-stack.wast @@ -12,19 +12,18 @@ ) (func $stackAlloc (; 1 ;) (param $0 i32) (result i32) (local $1 i32) - (set_local $1 - (i32.load offset=4 - (i32.const 0) - ) - ) (i32.store offset=4 (i32.const 0) - (i32.and - (i32.sub - (get_local $1) - (get_local $0) + (tee_local $1 + (i32.and + (i32.sub + (i32.load offset=4 + (i32.const 0) + ) + (get_local $0) + ) + (i32.const -16) ) - (i32.const -16) ) ) (get_local $1) |