summaryrefslogtreecommitdiff
path: root/src/asmjs
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-09-16 09:33:08 -0700
committerGitHub <noreply@github.com>2022-09-16 09:33:08 -0700
commitd797c751df60aa5731a0cfaed1cc00811a5e273b (patch)
treecb7357ce0f6cfb25774f8565342909bb3df0210e /src/asmjs
parent3892b0bbe0aa0e57864e6785e43d33e89d39000b (diff)
downloadbinaryen-d797c751df60aa5731a0cfaed1cc00811a5e273b.tar.gz
binaryen-d797c751df60aa5731a0cfaed1cc00811a5e273b.tar.bz2
binaryen-d797c751df60aa5731a0cfaed1cc00811a5e273b.zip
wasm2js: Don't assume that `env.abort` can always be impored. (#5049)
This import was being injected and then used to implement trapping. Rather than injecting an import that doesn't exist in the original module we instead use the existing mechanism to implement this as an internal helper.
Diffstat (limited to 'src/asmjs')
-rw-r--r--src/asmjs/shared-constants.cpp2
-rw-r--r--src/asmjs/shared-constants.h1
2 files changed, 1 insertions, 2 deletions
diff --git a/src/asmjs/shared-constants.cpp b/src/asmjs/shared-constants.cpp
index 20b148155..f66b5de18 100644
--- a/src/asmjs/shared-constants.cpp
+++ b/src/asmjs/shared-constants.cpp
@@ -94,7 +94,6 @@ cashew::IString WASM_I64_SREM("__wasm_i64_srem");
cashew::IString WASM_I64_UREM("__wasm_i64_urem");
cashew::IString ASM_FUNC("asmFunc");
-cashew::IString ABORT_FUNC("abort");
cashew::IString FUNCTION_TABLE("FUNCTION_TABLE");
cashew::IString NO_RESULT("wasm2js$noresult"); // no result at all
// result in an expression, no temp var
@@ -116,6 +115,7 @@ cashew::IString DATA_DROP("wasm2js_data_drop");
cashew::IString ATOMIC_WAIT_I32("wasm2js_atomic_wait_i32");
cashew::IString ATOMIC_RMW_I64("wasm2js_atomic_rmw_i64");
cashew::IString GET_STASHED_BITS("wasm2js_get_stashed_bits");
+cashew::IString TRAP("wasm2js_trap");
} // namespace wasm2js
} // namespace ABI
diff --git a/src/asmjs/shared-constants.h b/src/asmjs/shared-constants.h
index 20edacb7e..cebe8baaa 100644
--- a/src/asmjs/shared-constants.h
+++ b/src/asmjs/shared-constants.h
@@ -97,7 +97,6 @@ extern cashew::IString WASM_I64_SREM;
extern cashew::IString WASM_I64_UREM;
// wasm2js constants
extern cashew::IString ASM_FUNC;
-extern cashew::IString ABORT_FUNC;
extern cashew::IString FUNCTION_TABLE;
extern cashew::IString NO_RESULT;
extern cashew::IString EXPRESSION_RESULT;