Prevent creating labels outside of sections

This doesn't make sense, and causes RGBLINK to misbehave
This commit is contained in:
ISSOtm
2019-11-04 03:34:18 +01:00
parent d6a43f6a53
commit 122f5fe12e
8 changed files with 25 additions and 0 deletions

View File

@@ -634,6 +634,10 @@ void sym_AddReloc(char *tzSym)
nsym->pScope = scope;
nsym->pSection = pCurrentSection;
/* Labels need to be assigned a section, except PC */
if (!pCurrentSection && strcmp(tzSym, "@"))
yyerror("Label \"%s\" created outside of a SECTION",
tzSym);
updateSymbolFilename(nsym);
}