Fix BANK(@) outside sections causing crashes

This commit is contained in:
ISSOtm
2020-04-07 15:45:30 +02:00
parent 562835308b
commit 9f82fa4cf7
5 changed files with 14 additions and 2 deletions

View File

@@ -282,7 +282,12 @@ static int32_t computeRPNExpr(struct Patch const *patch,
break;
case RPN_BANK_SELF:
value = patch->pcSection->bank;
if (!patch->pcSection) {
error("%s: PC has no bank outside a section");
value = 1;
} else {
value = patch->pcSection->bank;
}
break;
case RPN_HRAM: