Commit afb6221b authored by Dave Cheney's avatar Dave Cheney

cmd/6g: fix undefined behavior in reg.c

Update #8527

Fixes, cmd/6g/reg.c:847:24: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

LGTM=minux, rsc
R=minux, rsc
CC=dvyukov, golang-codereviews
https://golang.org/cl/129290043
parent 326f48eb
...@@ -844,7 +844,7 @@ prop(Reg *r, Bits ref, Bits cal) ...@@ -844,7 +844,7 @@ prop(Reg *r, Bits ref, Bits cal)
if(v == v1 || ((cal.b[j/32]>>(j&31))&1) == 0) { if(v == v1 || ((cal.b[j/32]>>(j&31))&1) == 0) {
for(; v1 != nil; v1 = v1->nextinnode) { for(; v1 != nil; v1 = v1->nextinnode) {
j = v1 - var; j = v1 - var;
cal.b[j/32] |= 1<<(j&31); cal.b[j/32] |= 1UL<<(j&31);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment