1
0
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:
Shenghou Ma 2012-05-25 00:08:52 +08:00
parent b0702bd0db
commit 34ad3995e0

View File

@ -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: