0da0930c1c2bd366780ecef13f846ad738b24bb9 — Michael Forney 7 months ago 9b719c7
fold: Prevent error when address is used as operand
1 files changed, 2 insertions(+), 5 deletions(-)

M fold.c
M fold.c => fold.c +2 -5
@@ 363,11 363,8 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr)
 		else if (cr->type == CAddr)
 			err("undefined substraction (num - addr)");
 	}
-	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;