mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Merge pull request #16 from yenatch/eval-rpn-bank
rgbasm: Evaluate BANK() arguments to verify they exist.
This commit is contained in:
@@ -114,14 +114,11 @@ void
|
|||||||
rpn_Bank(struct Expression * expr, char *tzSym)
|
rpn_Bank(struct Expression * expr, char *tzSym)
|
||||||
{
|
{
|
||||||
if (!sym_isConstant(tzSym)) {
|
if (!sym_isConstant(tzSym)) {
|
||||||
struct sSymbol *psym;
|
|
||||||
|
|
||||||
rpn_Reset(expr);
|
rpn_Reset(expr);
|
||||||
|
|
||||||
psym = sym_FindSymbol(tzSym);
|
/* Check that the symbol exists by evaluating and discarding the value. */
|
||||||
if (nPass == 2 && psym == NULL) {
|
sym_GetValue(tzSym);
|
||||||
yyerror("'%s' not defined", tzSym);
|
|
||||||
}
|
|
||||||
expr->isReloc = 1;
|
expr->isReloc = 1;
|
||||||
pushbyte(expr, RPN_BANK);
|
pushbyte(expr, RPN_BANK);
|
||||||
while (*tzSym)
|
while (*tzSym)
|
||||||
|
|||||||
Reference in New Issue
Block a user