summaryrefslogtreecommitdiff
path: root/src/asm2wasm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/asm2wasm.cpp')
-rw-r--r--src/asm2wasm.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/asm2wasm.cpp b/src/asm2wasm.cpp
index e3fb23c4f..28ff7d563 100644
--- a/src/asm2wasm.cpp
+++ b/src/asm2wasm.cpp
@@ -77,6 +77,7 @@ struct WasmWalker {
virtual Expression* walkCompare(Compare *curr) { return curr; };
virtual Expression* walkConvert(Convert *curr) { return curr; };
virtual Expression* walkHost(Host *curr) { return curr; };
+ virtual Expression* walkNop(Nop *curr) { return curr; };
// children-first
Expression *walk(Expression *curr) {
@@ -181,6 +182,10 @@ struct WasmWalker {
}
return walkHost(cast);
}
+ if (Nop *cast = dynamic_cast<Nop*>(curr)) {
+ return walkNop(cast);
+ }
+ abort();
}
void startWalk(Function *func) {
@@ -1040,9 +1045,7 @@ Function* Asm2WasmModule::processFunction(Ref ast) {
return ret;
} else if (what == SWITCH) {
// XXX switch is still in flux in the spec repo, just emit a placeholder
- auto ret = allocator.alloc<Block>();
- ret->var = IString("SWITCH_PLACEHOLDER");
- return ret;
+ return allocator.alloc<Nop>();
#if 0
IString name = getNextId("switch");
breakStack.push_back(name);