Skip to content

Commit 45c7a7f

Browse files
committed
WebAssembly: tee_local should not throw when trying to set Unreachable, but it should always yield the type of the local its trying to set
1 parent 72302b4 commit 45c7a7f

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

lib/WasmReader/WasmByteCodeGenerator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,8 @@ EmitInfo WasmBytecodeGenerator::EmitSetLocal(bool tee)
963963
{
964964
if (info.type == WasmTypes::Any)
965965
{
966-
throw WasmCompilationException(_u("Can't tee_local unreachable values"));
966+
info.location = local.location;
967+
info.type = local.type;
967968
}
968969
return info;
969970
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
(43) testsuite/core/br.wast:387: assert_return($$.as-tee_local-value() == i32:1) failed. Unexpectedly threw: CompileError: function as-tee_local-value[39] at offset 1784/2165 (0x6f8/0x875): Can't tee_local unreachable values
2-
70/71 tests passed.
1+
71/71 tests passed.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
(49) testsuite/core/return.wast:285: assert_return($$.as-tee_local-value() == i32:1) failed. Unexpectedly threw: CompileError: function as-tee_local-value[45] at offset 1672/1839 (0x688/0x72f): Can't tee_local unreachable values
2-
66/67 tests passed.
1+
67/67 tests passed.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
(47) testsuite/core/unreachable.wast:275: assert_trap($$.as-tee_local-value()) failed. Unexpected error thrown: CompileError: function as-tee_local-value[43] at offset 1588/1711 (0x634/0x6af): Can't tee_local unreachable values
2-
61/62 tests passed.
1+
62/62 tests passed.

0 commit comments

Comments
 (0)