summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorSivchari <55221074+sivchari@users.noreply.github.com>2021-04-22 02:47:01 +0900
committerGitHub <noreply@github.com>2021-04-21 19:47:01 +0200
commitfb32fff8dcf2b15a469e5cce07b10d88aa6352ee (patch)
tree579c73d9a128a98845494774460c23c49c444e3d /compiler
parent4471141a1d68158f3f23c6584d1f0434807c0203 (diff)
downloadNim-fb32fff8dcf2b15a469e5cce07b10d88aa6352ee.tar.gz
js generates spurious >>> on shr (#17767)
* js generates spurious >>> on shr
* Add shr arithmetic test
* fix variables from const to let during testing
Diffstat (limited to 'compiler')
-rw-r--r--compiler/jsgen.nim3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index e75ff182f..53ce45e96 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -683,8 +683,7 @@ proc arith(p: PProc, n: PNode, r: var TCompRes, op: TMagic) =
     var x, y: TCompRes
     gen(p, n[1], x)
     gen(p, n[2], y)
-    let trimmer = unsignedTrimmer(n[1].typ.skipTypes(abstractRange).size)
-    r.res = "(($1 $2) >>> $3)" % [x.rdLoc, trimmer, y.rdLoc]
+    r.res = "($1 >>> $2)" % [x.rdLoc, y.rdLoc]
   of mCharToStr, mBoolToStr, mIntToStr, mInt64ToStr, mFloatToStr,
       mCStrToStr, mStrToStr, mEnumToStr:
     arithAux(p, n, r, op)