mirror of
https://github.com/golang/go
synced 2024-11-15 08:40:59 -07:00
[release-branch.go1] cmd/cc: fix uint right shift in constant evaluation
««« backport aa2d2fa1e5a9 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
536be05e32
commit
b260999d4c
@ -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