mirror of
https://github.com/golang/go
synced 2024-11-20 00:44:45 -07:00
cmd/cc: fix uint right shift in constant evaluation
Fixes #3664. R=golang-dev, bradfitz, rsc CC=golang-dev https://golang.org/cl/6249048
This commit is contained in:
parent
b0702bd0db
commit
34ad3995e0
@ -175,7 +175,10 @@ evconst(Node *n)
|
||||
break;
|
||||
|
||||
case OLSHR:
|
||||
v = (uvlong)l->vconst >> r->vconst;
|
||||
if(l->type->width != sizeof(uvlong))
|
||||
v = ((uvlong)l->vconst & 0xffffffffULL) >> r->vconst;
|
||||
else
|
||||
v = (uvlong)l->vconst >> r->vconst;
|
||||
break;
|
||||
|
||||
case OASHR:
|
||||
|
Loading…
Reference in New Issue
Block a user