summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPMunch <peterme@peterme.net>2020-09-02 08:07:08 +0000
committerGitHub <noreply@github.com>2020-09-02 10:07:08 +0200
commit244760197cf1d24829ae45de5f25c10577152cdd (patch)
tree193a9f5bd27033fd3491b81da1beb84b19a363e8
parentff13f8cc3c74d4048b6c2604fe4b8e5365f5c13f (diff)
downloadNim-244760197cf1d24829ae45de5f25c10577152cdd.tar.gz
Fix sets for architectures with default integers smaller than 32 bits (#15258) [backport]
-rw-r--r--compiler/ccgexprs.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 6da44a33a..dd4774b2a 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1796,9 +1796,9 @@ template binaryExprIn(p: BProc, e: PNode, a, b, d: var TLoc, frmt: string) =
 
 proc genInExprAux(p: BProc, e: PNode, a, b, d: var TLoc) =
   case int(getSize(p.config, skipTypes(e[1].typ, abstractVar)))
-  of 1: binaryExprIn(p, e, a, b, d, "(($1 &(1U<<((NU)($2)&7U)))!=0)")
-  of 2: binaryExprIn(p, e, a, b, d, "(($1 &(1U<<((NU)($2)&15U)))!=0)")
-  of 4: binaryExprIn(p, e, a, b, d, "(($1 &(1U<<((NU)($2)&31U)))!=0)")
+  of 1: binaryExprIn(p, e, a, b, d, "(($1 &((NU8)1<<((NU)($2)&7U)))!=0)")
+  of 2: binaryExprIn(p, e, a, b, d, "(($1 &((NU16)1<<((NU)($2)&15U)))!=0)")
+  of 4: binaryExprIn(p, e, a, b, d, "(($1 &((NU32)1<<((NU)($2)&31U)))!=0)")
   of 8: binaryExprIn(p, e, a, b, d, "(($1 &((NU64)1<<((NU)($2)&63U)))!=0)")
   else: binaryExprIn(p, e, a, b, d, "(($1[(NU)($2)>>3] &(1U<<((NU)($2)&7U)))!=0)")