Merge pull request #16 from yenatch/eval-rpn-bank

rgbasm: Evaluate BANK() arguments to verify they exist.
This commit is contained in:
AntonioND
2017-02-27 21:21:45 +00:00
committed by GitHub

View File

@@ -114,14 +114,11 @@ void
rpn_Bank(struct Expression * expr, char *tzSym)
{
if (!sym_isConstant(tzSym)) {
struct sSymbol *psym;
rpn_Reset(expr);
psym = sym_FindSymbol(tzSym);
if (nPass == 2 && psym == NULL) {
yyerror("'%s' not defined", tzSym);
}
/* Check that the symbol exists by evaluating and discarding the value. */
sym_GetValue(tzSym);
expr->isReloc = 1;
pushbyte(expr, RPN_BANK);
while (*tzSym)