Report error when shifting outside a macro

This commit is contained in:
Jakub Kądziołka
2020-10-12 00:40:33 +02:00
parent 6a8ae643d5
commit 217c10ddac
4 changed files with 7 additions and 1 deletions

View File

@@ -130,7 +130,9 @@ uint32_t macro_UseNewUniqueID(void)
void macro_ShiftCurrentArgs(void)
{
if (macroArgs->shift != macroArgs->nbArgs)
if (!macroArgs)
error("Cannot shift macro arguments outside of a macro\n");
else if (macroArgs->shift != macroArgs->nbArgs)
macroArgs->shift++;
}