From abb498167e4c8178a5cb6cd22dcf106959eaa7d4 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 7 Aug 2016 12:04:25 -0700 Subject: don't depend on order of operations in calls, it varies by compiler --- src/asm2wasm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 2d0d1300e..4d2ddb0cd 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -1277,7 +1277,9 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { } abort_on("bad unary", ast); } else if (what == IF) { - return builder.makeIf(process(ast[1]), process(ast[2]), !!ast[3] ? process(ast[3]) : nullptr); + auto* condition = process(ast[1]); + auto* ifTrue = process(ast[2]); + return builder.makeIf(condition, ifTrue, !!ast[3] ? process(ast[3]) : nullptr); } else if (what == CALL) { if (ast[1][0] == NAME) { IString name = ast[1][1]->getIString(); -- cgit v1.2.3