From 31fca059e62a10b0f1d3de3a3f517721a41a7595 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 22 Aug 2016 21:29:14 -0700 Subject: finalize loops in asm2wasm, which is now necessary as they may need to be dropped --- src/asm2wasm.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index abe6e2f25..d11fb3cfb 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -1492,7 +1492,9 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { auto continuer = allocator.alloc(); continuer->name = ret->name; block->list.push_back(continuer); + block->finalize(); ret->body = block; + ret->finalize(); continueStack.pop_back(); breakStack.pop_back(); return ret; @@ -1528,6 +1530,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { auto loop = allocator.alloc(); loop->body = child; loop->name = more; + loop->finalize(); return builder.blockifyWithName(loop, stop); } } @@ -1553,6 +1556,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { continuer->condition = process(ast[1]); Block *block = builder.blockifyWithName(loop->body, out, continuer); loop->body = block; + loop->finalize(); return loop; } else if (what == FOR) { Ref finit = ast[1], @@ -1588,6 +1592,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { continuer->name = ret->name; Block* block = builder.blockifyWithName(ret->body, out, continuer); ret->body = block; + ret->finalize(); continueStack.pop_back(); breakStack.pop_back(); Block *outer = allocator.alloc(); -- cgit v1.2.3