Commit 34ad3995 authored by Shenghou Ma's avatar Shenghou Ma

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 b0702bd0
......@@ -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