From 1c25d8bd86c466306cc8e0bebed4fe7ae066e64e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 2 Nov 2015 17:30:37 -0800 Subject: fix while (condition) loops --- src/asm2wasm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 04d4db21c..65d837496 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -881,10 +881,11 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { ret->body = process(ast[2]); } else { Break *breakOut = allocator.alloc(); - breakOut->name = in; + breakOut->name = out; If *condition = allocator.alloc(); condition->condition = process(ast[1]); - condition->ifTrue = breakOut; + condition->ifTrue = allocator.alloc(); + condition->ifFalse = breakOut; auto body = allocator.alloc(); body->list.push_back(condition); body->list.push_back(process(ast[2])); -- cgit v1.2.3