From d797c751df60aa5731a0cfaed1cc00811a5e273b Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 16 Sep 2022 09:33:08 -0700 Subject: 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. --- src/asmjs/shared-constants.cpp | 2 +- src/asmjs/shared-constants.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src/asmjs') 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; -- cgit v1.2.3