Wasm: fix the way '!' expression translated. Also fix #365

This commit is contained in:
Alexey Andreev 2018-11-06 14:34:18 +03:00
parent 473e33a261
commit 4a7b70e1e8

View File

@ -1376,7 +1376,7 @@ class WasmGenerationVisitor implements StatementVisitor, ExprVisitor {
} }
} }
return new WasmIntBinary(WasmIntType.INT32, WasmIntBinaryOperation.XOR, expr, new WasmInt32Constant(1)); return new WasmIntBinary(WasmIntType.INT32, WasmIntBinaryOperation.EQ, expr, new WasmInt32Constant(0));
} }
private boolean isOne(WasmExpression expression) { private boolean isOne(WasmExpression expression) {