Properly handle missing symbols

Fixes #512
This commit is contained in:
ISSOtm
2020-04-12 22:52:32 +02:00
parent 828edb7403
commit 023a3c037f
3 changed files with 11 additions and 1 deletions

View File

@@ -337,7 +337,11 @@ static int32_t computeRPNExpr(struct Patch const *patch,
symbol = getSymbol(fileSymbols, value);
if (strcmp(symbol->name, "@")) {
if (!symbol) {
error("%s: Unknown symbol \"%s\"",
patch->fileName,
fileSymbols[value]->name);
} else if (strcmp(symbol->name, "@")) {
value = symbol->value;
/* Symbols attached to sections have offsets */
if (symbol->section)