Prevent RGBLINK from crashing when getting the bank of a constant

This commit is contained in:
ISSOtm
2020-04-07 20:41:20 +02:00
parent 9f82fa4cf7
commit 190678107b
5 changed files with 17 additions and 0 deletions

View File

@@ -260,6 +260,11 @@ static int32_t computeRPNExpr(struct Patch const *patch,
patch->fileName,
fileSymbols[value]->name);
value = 1;
} else if (!symbol->section) {
error("%s: Requested BANK() of non-label symbol \"%s\"",
patch->fileName,
fileSymbols[value]->name);
value = 1;
} else {
value = symbol->section->bank;
}