Commit 2c050571 authored by Ken Thompson's avatar Ken Thompson

shift bugs

R=r
OCL=18095
CL=18095
parent 9639bd0d
......@@ -12,6 +12,7 @@ convlit(Node *n, Type *t)
if(n == N || t == T)
return;
switch(n->op) {
default:
return;
......@@ -25,7 +26,6 @@ convlit(Node *n, Type *t)
}
et = t->etype;
wt = whatis(n);
switch(wt) {
......
......@@ -84,7 +84,7 @@ mprsh(Mpint *a)
if(x & 1)
c = Mpbase;
}
if(a->neg && lo == 0)
if(a->neg && lo != 0)
mpaddcfix(a, -1);
}
......@@ -105,7 +105,7 @@ mprshw(Mpint *a)
a1++;
}
a1[0] = 0;
if(a->neg && lo == 0)
if(a->neg && lo != 0)
mpaddcfix(a, -1);
}
......
......@@ -170,6 +170,8 @@ walktype(Node *n, int top)
int et, cl, cr;
int32 lno;
if(n == N)
return;
lno = setlineno(n);
/*
......@@ -645,8 +647,10 @@ loop:
evconst(n);
if(n->op == OLITERAL)
goto ret;
convlit(n->right, types[TUINT]);
convlit(n->left, types[TINT]);
if(n->left->type == T)
convlit(n->left, types[TINT]);
if(n->right->type == T)
convlit(n->right, types[TUINT]);
if(n->left->type == T || n->right->type == T)
goto ret;
if(issigned[n->right->type->etype])
......
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