mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Report error when shifting outside a macro
This commit is contained in:
@@ -130,7 +130,9 @@ uint32_t macro_UseNewUniqueID(void)
|
|||||||
|
|
||||||
void macro_ShiftCurrentArgs(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++;
|
macroArgs->shift++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
test/asm/shift-outside-macro.asm
Normal file
1
test/asm/shift-outside-macro.asm
Normal file
@@ -0,0 +1 @@
|
|||||||
|
shift
|
||||||
3
test/asm/shift-outside-macro.err
Normal file
3
test/asm/shift-outside-macro.err
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ERROR: shift-outside-macro.asm(1):
|
||||||
|
Cannot shift macro arguments outside of a macro
|
||||||
|
error: Assembly aborted (1 errors)!
|
||||||
0
test/asm/shift-outside-macro.out
Normal file
0
test/asm/shift-outside-macro.out
Normal file
Reference in New Issue
Block a user