summary refs log tree commit diff
path: root/amd64
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2021-07-30 00:11:27 +0200
committerQuentin Carbonneaux <quentin@c9x.me>2021-07-30 00:14:53 +0200
commit3da3815a674c922c520e013b30eb96c7491a5e85 (patch)
treed82dde5bf3269d0aad173f7d8e60e08d5519fb8f /amd64
parent98cd2e817616fff14622b8e514fc88b378a100ef (diff)
downloadroux-3da3815a674c922c520e013b30eb96c7491a5e85.tar.gz
err when an address contains a sum $a+$b (afl)
Reported by Alessandro Mantovani.
These addresses are likely bogus, but
they triggered an unwarranted assertion
failure. We now raise a civilized error.
Diffstat (limited to 'amd64')
-rw-r--r--amd64/isel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/amd64/isel.c b/amd64/isel.c
index e8a78f3..0b0a2df 100644
--- a/amd64/isel.c
+++ b/amd64/isel.c
@@ -512,7 +512,9 @@ amatch(Addr *a, Ref r, int n, ANum *ai, Fn *fn)
 	Ref al, ar;
 
 	if (rtype(r) == RCon) {
-		addcon(&a->offset, &fn->con[r.val]);
+		if (!addcon(&a->offset, &fn->con[r.val]))
+			err("unlikely sum of $%s and $%s",
+				str(a->offset.label), str(fn->con[r.val].label));
 		return 1;
 	}
 	assert(rtype(r) == RTmp);