shithub: rgbds

Download patch

ref: 27a350eaaba3433d979ab548c90488a1564fac64
parent: cd8d895c1b5695c63d4faa3efb97c4b70fe3bf3e
parent: 424702b272c78e1bc5a9e383948561f569467cde
author: Anthony J. Bentley <[email protected]>
date: Sun Oct 5 21:55:19 EDT 2014

Merge branch 'fix-uniquearg-segfault' of https://github.com/chastai/rgbds

--- a/src/asm/globlex.c
+++ b/src/asm/globlex.c
@@ -223,9 +223,15 @@
 ULONG 
 PutUniqueArg(char *src, ULONG size)
 {
+	char *s;
+
 	src = src;
 	yyskipbytes(size);
-	yyunputstr(sym_FindMacroArg(-1));
+	if ((s = sym_FindMacroArg(-1)) != NULL) {
+		yyunputstr(s);
+	} else {
+		yyerror("Macro unique label string not defined");
+	}
 	return (0);
 }