diff options
-rw-r--r-- | src/wasm/wasm-binary.cpp | 5 | ||||
-rw-r--r-- | src/wasm/wasm.cpp | 4 | ||||
-rw-r--r-- | test/wasm2js/br_table.2asm.js | 12 | ||||
-rw-r--r-- | test/wasm2js/br_table_temp.2asm.js | 12 |
4 files changed, 18 insertions, 15 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index 95658cbe7..4804626da 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -6508,7 +6508,10 @@ void WasmBinaryBuilder::visitRethrow(Rethrow* curr) { BYN_TRACE("zz node: Rethrow\n"); curr->target = getExceptionTargetName(getU32LEB()); // This special target is valid only for delegates - assert(curr->target != DELEGATE_CALLER_TARGET); + if (curr->target == DELEGATE_CALLER_TARGET) { + throwError(std::string("rethrow target cannot use internal name ") + + DELEGATE_CALLER_TARGET.str); + } curr->finalize(); } diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index d220b7162..aac8b44fe 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -91,8 +91,8 @@ Name NEG_NAN("-nan"); Name CASE("case"); Name BR("br"); Name FUNCREF("funcref"); -Name FAKE_RETURN("fake_return_waka123"); -Name DELEGATE_CALLER_TARGET("delegate_caller_target_waka123"); +Name FAKE_RETURN("__binaryen_fake_return"); +Name DELEGATE_CALLER_TARGET("__binaryen_delegate_caller_target"); Name MUT("mut"); Name SPECTEST("spectest"); Name PRINT("print"); diff --git a/test/wasm2js/br_table.2asm.js b/test/wasm2js/br_table.2asm.js index a95871c22..be7b89b9f 100644 --- a/test/wasm2js/br_table.2asm.js +++ b/test/wasm2js/br_table.2asm.js @@ -12560,12 +12560,12 @@ function asmFunc(env) { function $20() { var $1_1 = 0, $2_1 = 0, $4_1 = 0; - fake_return_waka123 : { + __binaryen_fake_return : { loop_in : while (1) { $1_1 = 3; switch (0 | 0) { default: - break fake_return_waka123; + break __binaryen_fake_return; }; }; } @@ -12574,13 +12574,13 @@ function asmFunc(env) { function $21() { var $1_1 = 0, $2_1 = 0, $4_1 = 0; - fake_return_waka123 : { + __binaryen_fake_return : { loop_in : while (1) { dummy(); $1_1 = 4; switch (-1 | 0) { default: - break fake_return_waka123; + break __binaryen_fake_return; }; }; } @@ -12589,13 +12589,13 @@ function asmFunc(env) { function $22() { var $1_1 = 0; - fake_return_waka123 : { + __binaryen_fake_return : { loop_in : while (1) { dummy(); $1_1 = 5; switch (1 | 0) { default: - break fake_return_waka123; + break __binaryen_fake_return; }; }; } diff --git a/test/wasm2js/br_table_temp.2asm.js b/test/wasm2js/br_table_temp.2asm.js index 3414631e0..32850d080 100644 --- a/test/wasm2js/br_table_temp.2asm.js +++ b/test/wasm2js/br_table_temp.2asm.js @@ -12556,12 +12556,12 @@ function asmFunc(env) { function $20() { var $1_1 = 0, $2_1 = 0, $4_1 = 0; - fake_return_waka123 : { + __binaryen_fake_return : { loop_in : while (1) { $1_1 = 3; switch (0 | 0) { default: - break fake_return_waka123; + break __binaryen_fake_return; }; }; } @@ -12570,13 +12570,13 @@ function asmFunc(env) { function $21() { var $1_1 = 0, $2_1 = 0, $4_1 = 0; - fake_return_waka123 : { + __binaryen_fake_return : { loop_in : while (1) { dummy(); $1_1 = 4; switch (-1 | 0) { default: - break fake_return_waka123; + break __binaryen_fake_return; }; }; } @@ -12585,13 +12585,13 @@ function asmFunc(env) { function $22() { var $1_1 = 0; - fake_return_waka123 : { + __binaryen_fake_return : { loop_in : while (1) { dummy(); $1_1 = 5; switch (1 | 0) { default: - break fake_return_waka123; + break __binaryen_fake_return; }; }; } |