mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 19:22:05 +00:00
Check if parent exists for local label reference
If an attempt is made to reference a local label before any non-local label is defined, raise an error instead of segfaulting.
This commit is contained in:
@@ -735,6 +735,9 @@ void sym_Ref(char *tzSym)
|
||||
int isLocal = 0;
|
||||
|
||||
if (*tzSym == '.') {
|
||||
if (!pScope)
|
||||
fatalerror("Local label reference '%s' in main scope",
|
||||
tzSym);
|
||||
fullSymbolName(fullname, sizeof(fullname), tzSym,
|
||||
pScope);
|
||||
tzSym = fullname;
|
||||
|
||||
Reference in New Issue
Block a user