summaryrefslogtreecommitdiff
path: root/scripts/wasm2js.js
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-10-05 17:31:33 -0700
committerGitHub <noreply@github.com>2022-10-06 00:31:33 +0000
commite6be381b6f5adbd07af080a4e1f74ba04c8eda82 (patch)
treed417915798255b0dc315d75cbd2a941658c4adca /scripts/wasm2js.js
parentc43721a1ae80539aea5ea9d8d295b7e377aa03f5 (diff)
downloadbinaryen-e6be381b6f5adbd07af080a4e1f74ba04c8eda82.tar.gz
binaryen-e6be381b6f5adbd07af080a4e1f74ba04c8eda82.tar.bz2
binaryen-e6be381b6f5adbd07af080a4e1f74ba04c8eda82.zip
Fix fuzzer after #5114 (#5117)
Fixes ./scripts/fuzz_opt.py --auto-initial-contents 7044408155933374954
Diffstat (limited to 'scripts/wasm2js.js')
-rw-r--r--scripts/wasm2js.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/wasm2js.js b/scripts/wasm2js.js
index 4a16184d0..d76e37280 100644
--- a/scripts/wasm2js.js
+++ b/scripts/wasm2js.js
@@ -64,9 +64,9 @@ var WebAssembly = {
};
var atob = decodeBase64;
// Additional imports
- asmLibraryArg['__tempMemory__'] = 0; // risky!
+ info['env']['__tempMemory__'] = 0; // risky!
// This will be replaced by the actual wasm2js code.
- var exports = instantiate(asmLibraryArg, wasmMemory);
+ var exports = instantiate(info, wasmMemory);
return {
'exports': exports
};
@@ -85,7 +85,7 @@ var WebAssembly = {
var tempRet0 = 0;
-var asmLibraryArg = {
+var env = {
log_i32: function(x) {
console.log('[LoggingExternalInterface logging ' + literal(x, 'i32') + ']');
},
@@ -113,7 +113,7 @@ var asmLibraryArg = {
},
get_i64: function(loc, index, low, high) {
console.log('get_i64 ' + [loc, index, low, high]);
- asmLibraryArg['setTempRet0'](high);
+ env['setTempRet0'](high);
return low;
},
get_f32: function(loc, index, value) {
@@ -130,7 +130,7 @@ var asmLibraryArg = {
},
set_i64: function(loc, index, low, high) {
console.log('set_i64 ' + [loc, index, low, high]);
- asmLibraryArg['setTempRet0'](high);
+ env['setTempRet0'](high);
return low;
},
set_f32: function(loc, index, value) {
@@ -151,7 +151,7 @@ var asmLibraryArg = {
},
load_val_i64: function(loc, low, high) {
console.log('load_val_i64 ' + [loc, low, high]);
- asmLibraryArg['setTempRet0'](high);
+ env['setTempRet0'](high);
return low;
},
load_val_f32: function(loc, value) {
@@ -172,7 +172,7 @@ var asmLibraryArg = {
},
store_val_i64: function(loc, low, high) {
console.log('store_val_i64 ' + [loc, low, high]);
- asmLibraryArg['setTempRet0'](high);
+ env['setTempRet0'](high);
return low;
},
store_val_f32: function(loc, value) {