Skip to content

Commit 2447601

Browse files
authored
Fix sets for architectures with default integers smaller than 32 bits (#15258) [backport]
1 parent ff13f8c commit 2447601

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/ccgexprs.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,9 +1796,9 @@ template binaryExprIn(p: BProc, e: PNode, a, b, d: var TLoc, frmt: string) =
17961796

17971797
proc genInExprAux(p: BProc, e: PNode, a, b, d: var TLoc) =
17981798
case int(getSize(p.config, skipTypes(e[1].typ, abstractVar)))
1799-
of 1: binaryExprIn(p, e, a, b, d, "(($1 &(1U<<((NU)($2)&7U)))!=0)")
1800-
of 2: binaryExprIn(p, e, a, b, d, "(($1 &(1U<<((NU)($2)&15U)))!=0)")
1801-
of 4: binaryExprIn(p, e, a, b, d, "(($1 &(1U<<((NU)($2)&31U)))!=0)")
1799+
of 1: binaryExprIn(p, e, a, b, d, "(($1 &((NU8)1<<((NU)($2)&7U)))!=0)")
1800+
of 2: binaryExprIn(p, e, a, b, d, "(($1 &((NU16)1<<((NU)($2)&15U)))!=0)")
1801+
of 4: binaryExprIn(p, e, a, b, d, "(($1 &((NU32)1<<((NU)($2)&31U)))!=0)")
18021802
of 8: binaryExprIn(p, e, a, b, d, "(($1 &((NU64)1<<((NU)($2)&63U)))!=0)")
18031803
else: binaryExprIn(p, e, a, b, d, "(($1[(NU)($2)>>3] &(1U<<((NU)($2)&7U)))!=0)")
18041804

0 commit comments

Comments
 (0)