mirror of
git://c9x.me/qbe.git
synced 2026-04-05 09:59:47 +00:00
fold: Prevent error when address is used as operand
This commit is contained in:
parent
49fb63ebac
commit
b0f16dad64
7
fold.c
7
fold.c
@ -363,11 +363,8 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr)
|
||||
else if (cr->type == CAddr)
|
||||
return 1;
|
||||
}
|
||||
else if (cl->type == CAddr || cr->type == CAddr) {
|
||||
if (Ocmpl <= op && op <= Ocmpl1)
|
||||
return 1;
|
||||
err("invalid address operand for '%s'", optab[op].name);
|
||||
}
|
||||
else if (cl->type == CAddr || cr->type == CAddr)
|
||||
return 1;
|
||||
switch (op) {
|
||||
case Oadd: x = l.u + r.u; break;
|
||||
case Osub: x = l.u - r.u; break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user