mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-22 22:05:11 +00:00
(uxnasm) Add error for relative references that are too far.
This commit is contained in:
parent
da797b33c6
commit
60f04ca053
1 changed files with 2 additions and 0 deletions
|
@ -351,6 +351,8 @@ resolve(void)
|
|||
if(!(l = findlabel(r->name)))
|
||||
return error("Unknown relative reference", r->name);
|
||||
p.data[r->addr + 1] = (Sint8)(l->addr - r->addr - 3);
|
||||
if((Sint8)p.data[r->addr + 1] != (l->addr - r->addr - 3))
|
||||
return error("Relative reference is too far", r->name);
|
||||
l->refs++;
|
||||
break;
|
||||
case ';':
|
||||
|
|
Loading…
Reference in a new issue