Fix passing constant label to BANK() causing an error

This commit is contained in:
ISSOtm
2020-03-07 18:02:06 +01:00
parent cb62076f8c
commit f6f25296a0
3 changed files with 11 additions and 7 deletions

View File

@@ -42,8 +42,8 @@ void rpn_HIGH(struct Expression *expr, const struct Expression *src);
void rpn_LOW(struct Expression *expr, const struct Expression *src);
void rpn_UNNEG(struct Expression *expr, const struct Expression *src);
void rpn_UNNOT(struct Expression *expr, const struct Expression *src);
void rpn_BankSymbol(struct Expression *expr, char *tzSym);
void rpn_BankSection(struct Expression *expr, char *tzSectionName);
void rpn_BankSymbol(struct Expression *expr, char const *tzSym);
void rpn_BankSection(struct Expression *expr, char const *tzSectionName);
void rpn_BankSelf(struct Expression *expr);
void rpn_Init(struct Expression *expr);
void rpn_Free(struct Expression *expr);

View File

@@ -59,10 +59,14 @@ static inline bool sym_IsNumeric(struct sSymbol const *sym)
|| sym->type == SYM_SET;
}
static inline bool sym_IsLabel(struct sSymbol const *sym)
{
return sym->type == SYM_LABEL || sym->type == SYM_REF;
}
static inline bool sym_IsLocal(struct sSymbol const *sym)
{
return (sym->type == SYM_LABEL || sym->type == SYM_REF)
&& strchr(sym->tzName, '.');
return sym_IsLabel(sym) && strchr(sym->tzName, '.');
}
static inline bool sym_IsExported(struct sSymbol const *sym)