diff options
author | Brion Vibber <brion@pobox.com> | 2019-08-30 14:20:48 -0700 |
---|---|---|
committer | Alon Zakai <azakai@google.com> | 2019-08-30 14:20:47 -0700 |
commit | c134c574e9e755a85806d42481c1b6d490d0d445 (patch) | |
tree | 67f50fb8957d177b8d84e01ab7e3eb4b290b0213 /test/wasm2js/address.2asm.js | |
parent | eace464174f1abefead072dc580244483e499af6 (diff) | |
download | binaryen-c134c574e9e755a85806d42481c1b6d490d0d445.tar.gz binaryen-c134c574e9e755a85806d42481c1b6d490d0d445.tar.bz2 binaryen-c134c574e9e755a85806d42481c1b6d490d0d445.zip |
Followup to workaround for minification of wasm2js mem init (#2318)
Emscripten's minifier mis-minifies a couple bits in the memory
init function that's used with wasm2js when not using an external
memory init file:
https://github.com/emscripten-core/emscripten/issues/8886
Previous fix worked around the bug in one place but failed to
account for another. Have now confirmed that it works with this
change in place.
Updated test cases to match.
Diffstat (limited to 'test/wasm2js/address.2asm.js')
-rw-r--r-- | test/wasm2js/address.2asm.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/wasm2js/address.2asm.js b/test/wasm2js/address.2asm.js index 6c1261a4e..c811a1a2e 100644 --- a/test/wasm2js/address.2asm.js +++ b/test/wasm2js/address.2asm.js @@ -82,14 +82,14 @@ var assignasmFunc = ( function(mem) { var _mem = new Uint8Array(mem); return function(offset, s) { - var bytes; + var bytes, i; if (typeof Buffer === 'undefined') { bytes = atob(s); - for (var i = 0; i < bytes.length; i++) + for (i = 0; i < bytes.length; i++) _mem[offset + i] = bytes.charCodeAt(i); } else { bytes = Buffer.from(s, 'base64'); - for (var i = 0; i < bytes.length; i++) + for (i = 0; i < bytes.length; i++) _mem[offset + i] = bytes[i]; } } |