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.
This commit is contained in:
Quentin Carbonneaux 2021-07-30 00:11:27 +02:00
parent 98cd2e8176
commit 3da3815a67
3 changed files with 8 additions and 4 deletions

View file

@ -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);