diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-12-05 22:08:50 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-12-05 22:08:50 -0800 |
commit | 1585a63c8846eef56b95f076be2ffe2f7e2f15da (patch) | |
tree | 116745d51d66aaaa06e3498a298878dee41fcfb7 /src/wasm2asm.h | |
parent | 5c3a102d7476b2200787aa66a84175bb47862c36 (diff) | |
download | binaryen-1585a63c8846eef56b95f076be2ffe2f7e2f15da.tar.gz binaryen-1585a63c8846eef56b95f076be2ffe2f7e2f15da.tar.bz2 binaryen-1585a63c8846eef56b95f076be2ffe2f7e2f15da.zip |
fix do-while label
Diffstat (limited to 'src/wasm2asm.h')
-rw-r--r-- | src/wasm2asm.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm2asm.h b/src/wasm2asm.h index 2ca6406b5..a19416e04 100644 --- a/src/wasm2asm.h +++ b/src/wasm2asm.h @@ -513,10 +513,11 @@ Ref Wasm2AsmBuilder::processFunctionBody(Expression* curr, IString result) { Name asmLabel = curr->out.is() ? curr->out : curr->in; // label using the outside, normal for breaks. if no outside, then inside if (curr->in.is()) continueLabels[curr->in] = asmLabel; Ref body = visit(curr->body, result); + Ref ret = ValueBuilder::makeDo(body, ValueBuilder::makeInt(0)); if (asmLabel.is()) { - body = ValueBuilder::makeLabel(fromName(asmLabel), body); + ret = ValueBuilder::makeLabel(fromName(asmLabel), ret); } - return ValueBuilder::makeDo(body, ValueBuilder::makeInt(0)); + return ret; } Ref visitLabel(Label *curr) override { return ValueBuilder::makeLabel(fromName(curr->name), visit(curr->body, result)); |