shithub: scc

Download patch

ref: 6f62daf42e5a640e1250ae7322d920a9d6ae81fa
parent: e2a51c17187b205422f06cf0516b1192a8db8220
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Jun 14 08:17:01 EDT 2016

[cc1] Avoid error with macros without pattern

A macro can be defined and not have a replacement string
so we have to test this case and don't try to expand
a NULL string.

--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -255,6 +255,8 @@
 		elen = sprintf(buffer, "%d ", input->nline);
 		goto substitute;
 	}
+	if (!s)
+		return 1;
 
 	if (!parsepars(arguments, arglist, atoi(s)))
 		return 0;