diff options
author | Alon Zakai <azakai@google.com> | 2020-09-10 12:49:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-10 12:49:40 -0700 |
commit | 739144d96d162b430d5fd54e4fe11b8ce2d34d47 (patch) | |
tree | 841a3dd2cbf2ebdf350cc9225c9ad4065b37fdd8 /test/wasm2js/minified-memory.wast | |
parent | 2aa0cf300998c62aea8cc6698f8325653a9f0895 (diff) | |
download | binaryen-739144d96d162b430d5fd54e4fe11b8ce2d34d47.tar.gz binaryen-739144d96d162b430d5fd54e4fe11b8ce2d34d47.tar.bz2 binaryen-739144d96d162b430d5fd54e4fe11b8ce2d34d47.zip |
Fix wasm2js memory import in case it is minified (#3113)
It was hardcoded as "env.memory", which is usually correct. But if we minify
import names, as in -O3 in emscripten, we need to use the minified name.
Note how in the test it now emits
var memory = env.a;
for the import.
Fixes emscripten-core/emscripten#12123
This was not noticed earlier since that import is only used in memory
growth. The tests that would catch it are wasm2js3.test*memory_growth*
but we only run wasm2js1 on CI. I'll add testing after this lands.
Diffstat (limited to 'test/wasm2js/minified-memory.wast')
-rw-r--r-- | test/wasm2js/minified-memory.wast | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/wasm2js/minified-memory.wast b/test/wasm2js/minified-memory.wast new file mode 100644 index 000000000..0fc1e3018 --- /dev/null +++ b/test/wasm2js/minified-memory.wast @@ -0,0 +1,6 @@ +(module + (import "env" "a" (memory $0 1)) + (func "foo" (result i32) + (i32.load (i32.const 0)) + ) +) |