summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/asm2wasm.h2
-rw-r--r--src/wasm/wasm.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index b71561d4d..2245bd2b5 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -1984,9 +1984,9 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
// No wasm support, so use a temp local
ensureI32Temp();
auto set = allocator.alloc<SetLocal>();
- set->setTee(false);
set->index = function->getLocalIndex(I32_TEMP);
set->value = value;
+ set->setTee(false);
set->finalize();
auto get = [&]() {
auto ret = allocator.alloc<GetLocal>();
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index 20b075fd1..4f5f46f0a 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -324,6 +324,7 @@ bool SetLocal::isTee() {
void SetLocal::setTee(bool is) {
if (is) type = value->type;
else type = none;
+ finalize(); // type may need to be unreachable
}
void SetLocal::finalize() {