From 9fc7f84edd71e5b97e063701f9cd2e7441333d42 Mon Sep 17 00:00:00 2001 From: bung87 Date: Sat, 25 Jul 2020 23:56:02 +0800 Subject: [PATCH] avoid #8231, bitwise move to mul,div --- compiler/jsgen.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index d876531e9486..bf657114aa15 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -602,8 +602,8 @@ proc arithAux(p: PProc, n: PNode, r: var TCompRes, op: TMagic) = of mMulF64: applyFormat("($1 * $2)", "($1 * $2)") of mDivF64: applyFormat("($1 / $2)", "($1 / $2)") of mShrI: applyFormat("", "") - of mShlI: applyFormat("($1 << $2)", "($1 << $2)") - of mAshrI: applyFormat("($1 >> $2)", "($1 >> $2)") + of mShlI: applyFormat("($1 * Math.pow(2,$2))", "($1 * Math.pow(2,$2))") + of mAshrI: applyFormat("($1 / Math.pow(2,$2))", "($1 / Math.pow(2,$2))") of mBitandI: applyFormat("($1 & $2)", "($1 & $2)") of mBitorI: applyFormat("($1 | $2)", "($1 | $2)") of mBitxorI: applyFormat("($1 ^ $2)", "($1 ^ $2)")