Commit 282bf8cc authored by Russ Cox's avatar Russ Cox

fix possible infinite recursion in eqtype.

don't use intermediate register to move
32-or-fewer-bit immediate constants
into memory.

R=ken
OCL=23726
CL=23726
parent 3ec46752
......@@ -554,7 +554,9 @@ gmove(Node *f, Node *t)
goto st;
st:
if(f->op == OCONST) {
// 64-bit immediates only allowed for move into registers.
// this is not a move into a register.
if(f->op == OCONST || (f->op == OLITERAL && !t64)) {
gins(a, f, t);
return;
}
......
......@@ -1707,7 +1707,7 @@ eqtype(Type *t1, Type *t2, int d)
return 0;
if(ta->etype != TFIELD || tb->etype != TFIELD)
return 0;
if(!eqtype(ta->type, tb->type, 0))
if(!eqtype(ta->type, tb->type, d+1))
return 0;
ta = ta->down;
tb = tb->down;
......
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