Commit 8d5ec52e authored by Dave Cheney's avatar Dave Cheney

cmd/6c, cmd/6g, cmd/cc: fix undefined behavior warnings

Update #5764

Like Tribbles, the more you kill, the more spring up in their place.

R=rsc
CC=golang-dev
https://golang.org/cl/13324049
parent 16d6b6c7
......@@ -36,7 +36,7 @@ gtext(Sym *s, int32 stkoff)
{
vlong v;
v = (argsize() << 32) | (stkoff & 0xffffffff);
v = ((uvlong)argsize() << 32) | (stkoff & 0xffffffff);
if((textflag & NOSPLIT) && stkoff >= 128)
yyerror("stack frame too large for NOSPLIT function");
......
......@@ -596,7 +596,7 @@ dodiv(int op, Node *nl, Node *nr, Node *res)
check = 0;
if(issigned[t->etype]) {
check = 1;
if(isconst(nl, CTINT) && mpgetfix(nl->val.u.xval) != -1LL<<(t->width*8-1))
if(isconst(nl, CTINT) && mpgetfix(nl->val.u.xval) != -(1ULL<<(t->width*8-1)))
check = 0;
else if(isconst(nr, CTINT) && mpgetfix(nr->val.u.xval) != -1)
check = 0;
......
......@@ -186,7 +186,7 @@ evconst(Node *n)
break;
case OASHL:
v = l->vconst << r->vconst;
v = (uvlong)l->vconst << r->vconst;
break;
case OLO:
......
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