uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 60f04ca053600c948a3b3e807884665b3b151db8
parent da797b33c6ae6523d385af63a38b0162f3a0caca
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Wed,  1 Dec 2021 11:42:44 +0000

(uxnasm) Add error for relative references that are too far.

Diffstat:
Msrc/uxnasm.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/uxnasm.c b/src/uxnasm.c @@ -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 ';':