Commit b260999d authored by Shenghou Ma's avatar Shenghou Ma

[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

»»»
parent 536be05e
......@@ -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:
......
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