shithub: rgbds

Download patch

ref: 89fb372326a8e527a4c48c42369cb2ebf8d40215
parent: a828f82414eb9b4ea828c32bf1bbfa43c875b32d
author: aaaaaa123456789 <[email protected]>
date: Tue May 12 02:46:17 EDT 2020

Set max macro arguments to 99,999

--- a/include/asm/asm.h
+++ b/include/asm/asm.h
@@ -22,7 +22,7 @@
 #include "asm/symbol.h"
 
 #define MAXUNIONS	128
-#define MAXMACROARGS	256
+#define MAXMACROARGS	99999
 #define MAXINCPATHS	128
 
 extern int32_t nLineNo;
--- a/src/asm/macro.c
+++ b/src/asm/macro.c
@@ -44,7 +44,8 @@
 	if ((**args).nbArgs == MAXMACROARGS)
 		yyerror("A maximum of " EXPAND_AND_STR(MAXMACROARGS)
 			" arguments is allowed");
-	*args = realloc(*args, sizeof **args + sizeof (char *) * (1 + (**args).nbArgs));
+	*args = realloc(*args, sizeof(**args) +
+	                       sizeof(char *) * (1 + (**args).nbArgs));
 	(**args).args[(**args).nbArgs++] = s;
 }