From b8d93ea629f59f534093d20f37cb8baf9809062e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 22 Apr 2019 09:37:15 -0700 Subject: wasm2js: remove some unneeded code, which also has some risks of incorrectness (#2032) The risk is that the children's type may be unreachable, in which case we may have forgotten the signing, and could get incorrect results. --- src/wasm2js.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/wasm2js.h b/src/wasm2js.h index 311f8be10..47d75e2c2 100644 --- a/src/wasm2js.h +++ b/src/wasm2js.h @@ -1648,21 +1648,12 @@ Ref Wasm2JSBuilder::processFunctionBody(Module* m, Function* func, IString resul ret = ValueBuilder::makeBinary(left, RSHIFT, right); break; case EqInt32: { - // TODO: check if this condition is still valid/necessary - if (curr->left->type == i32) { - return ValueBuilder::makeBinary(makeSigning(left, ASM_SIGNED), EQ, - makeSigning(right, ASM_SIGNED)); - } else { - return ValueBuilder::makeBinary(left, EQ, right); - } + return ValueBuilder::makeBinary(makeSigning(left, ASM_SIGNED), EQ, + makeSigning(right, ASM_SIGNED)); } case NeInt32: { - if (curr->left->type == i32) { - return ValueBuilder::makeBinary(makeSigning(left, ASM_SIGNED), NE, - makeSigning(right, ASM_SIGNED)); - } else { - return ValueBuilder::makeBinary(left, NE, right); - } + return ValueBuilder::makeBinary(makeSigning(left, ASM_SIGNED), NE, + makeSigning(right, ASM_SIGNED)); } case LtSInt32: return ValueBuilder::makeBinary(makeSigning(left, ASM_SIGNED), LT, -- cgit v1.2.3