mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Remove error message causing segfault
This was utterly stupid. The check right above ensured that `sym` was NULL, ergo that the argument to `yyerror` *would* segfault. The only two call sites cannot pass a non-NULL pointer anyways, which I'm betting is why this went unnoticed. I did what an optimizing compiler would do anyways: remove the dead code.
This commit is contained in:
@@ -75,6 +75,14 @@ static inline bool sym_IsExported(struct sSymbol const *sym)
|
|||||||
return sym->isExported;
|
return sym->isExported;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get a string equate's value
|
||||||
|
*/
|
||||||
|
static inline char *sym_GetStringValue(struct sSymbol const *sym)
|
||||||
|
{
|
||||||
|
return sym->pMacro;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t sym_GetValue(struct sSymbol const *sym);
|
int32_t sym_GetValue(struct sSymbol const *sym);
|
||||||
uint32_t sym_CalcHash(const char *s);
|
uint32_t sym_CalcHash(const char *s);
|
||||||
void sym_SetExportAll(bool set);
|
void sym_SetExportAll(bool set);
|
||||||
|
|||||||
@@ -249,19 +249,6 @@ void sym_Purge(char const *tzName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Get a string equate's value
|
|
||||||
*/
|
|
||||||
char *sym_GetStringValue(struct sSymbol const *sym)
|
|
||||||
{
|
|
||||||
if (sym != NULL)
|
|
||||||
return sym->pMacro;
|
|
||||||
|
|
||||||
yyerror("String symbol '%s' not defined", sym->tzName);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return a constant symbols value
|
* Return a constant symbols value
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user