mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 19:22:05 +00:00
Merge pull request #605 from NieDzejkob/invalid-labels
Don't consider difference of invalid labels constant
This commit is contained in:
@@ -309,7 +309,9 @@ bool rpn_IsDiffConstant(struct Expression const *src, struct Symbol const *sym)
|
||||
if (!sym1 || !sym || sym1->type != SYM_LABEL || sym->type != SYM_LABEL)
|
||||
return false;
|
||||
|
||||
return sym_GetSection(sym1) == sym_GetSection(sym);
|
||||
struct Section const *section1 = sym_GetSection(sym1);
|
||||
struct Section const *section2 = sym_GetSection(sym);
|
||||
return section1 && (section1 == section2);
|
||||
}
|
||||
|
||||
static bool isDiffConstant(struct Expression const *src1,
|
||||
|
||||
@@ -322,23 +322,6 @@ uint32_t sym_GetConstantValue(char const *s)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a defined symbols value... aborts if not defined yet
|
||||
*/
|
||||
uint32_t sym_GetDefinedValue(char const *s)
|
||||
{
|
||||
struct Symbol const *sym = sym_FindSymbol(s);
|
||||
|
||||
if (sym == NULL || !sym_IsDefined(sym))
|
||||
error("'%s' not defined\n", s);
|
||||
else if (!sym_IsNumeric(sym))
|
||||
error("'%s' is a macro or string symbol\n", s);
|
||||
else
|
||||
return sym_GetValue(sym);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
char const *sym_GetCurrentSymbolScope(void)
|
||||
{
|
||||
return labelScope;
|
||||
|
||||
Reference in New Issue
Block a user