summary refs log tree commit diff
path: root/fold.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-06-16 01:38:27 -0700
committerQuentin Carbonneaux <quentin@c9x.me>2021-11-10 23:27:17 +0100
commitb0f16dad64d14f36ffe235b2e9cca96aa3ce35ba (patch)
tree47ba4d0acfeaf94f170791009be3d92cc6f1040d /fold.c
parent49fb63ebac93dd5e23a65ceac8ce72dfa845d7fa (diff)
downloadroux-b0f16dad64d14f36ffe235b2e9cca96aa3ce35ba.tar.gz
fold: Prevent error when address is used as operand
Diffstat (limited to 'fold.c')
-rw-r--r--fold.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fold.c b/fold.c
index 5c09469..50a862e 100644
--- a/fold.c
+++ b/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;