From c7140e7bd23a36c9a8e8f869617c2f8e55d1f780 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 21 Nov 2015 19:54:50 -0800 Subject: fix do-while loops --- src/asm2wasm.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 204e014c9..f9999f011 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -1263,12 +1263,11 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { ret->body = process(ast[2]); continueStack.pop_back(); breakStack.pop_back(); - Break *breakOut = allocator.alloc(); - breakOut->name = out; + Break *continuer = allocator.alloc(); + continuer->name = in; If *condition = allocator.alloc(); condition->condition = process(ast[1]); - condition->ifTrue = allocator.alloc(); - condition->ifFalse = breakOut; + condition->ifTrue = continuer; Block *block = blockify(ret->body); block->list.push_back(condition); ret->body = block; -- cgit v1.2.3