Fix crash when no macro args are being used

This commit is contained in:
ISSOtm
2020-08-02 14:08:26 +02:00
parent 81a77a9b88
commit adcaf4cd46
2 changed files with 61 additions and 57 deletions

View File

@@ -89,6 +89,9 @@ void macro_FreeArgs(struct MacroArgs *args)
char const *macro_GetArg(uint32_t i)
{
if (!macroArgs)
return NULL;
uint32_t realIndex = i + macroArgs->shift - 1;
return realIndex >= macroArgs->nbArgs ? NULL