summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-12-05 20:20:06 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-12-05 20:20:06 -0800
commit0f592cc75ce20168a76264a76ed8dd62d7d00885 (patch)
tree25454273e1003b1445e2d793e5deced557f518d3 /src
parent1cdd8c414e3eeef6b69a4016ef23d639ce33cdee (diff)
downloadbinaryen-0f592cc75ce20168a76264a76ed8dd62d7d00885.tar.gz
binaryen-0f592cc75ce20168a76264a76ed8dd62d7d00885.tar.bz2
binaryen-0f592cc75ce20168a76264a76ed8dd62d7d00885.zip
fix wasm2asm switch
Diffstat (limited to 'src')
-rw-r--r--src/wasm2asm.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wasm2asm.h b/src/wasm2asm.h
index 6cdebe204..2630a3c82 100644
--- a/src/wasm2asm.h
+++ b/src/wasm2asm.h
@@ -543,13 +543,13 @@ Ref Wasm2AsmBuilder::processFunctionBody(Expression* curr, IString result) {
Ref value;
if (isStatement(curr->value)) {
ScopedTemp temp(i32, parent);
- ret[2]->push_back(visit(curr->value, temp));
+ flattenAppend(ret[2], visit(curr->value, temp));
value = temp.getAstName();
} else {
value = visit(curr->value, EXPRESSION_RESULT);
}
Ref theSwitch = ValueBuilder::makeSwitch(value);
- ret[2]->push_back(theSwitch);
+ ret[2][1]->push_back(theSwitch);
for (auto& c : curr->cases) {
bool added = false;
for (size_t i = 0; i < curr->targets.size(); i++) {