shithub: scc

Download patch

ref: 867607689050314f1cd07f567ec06ceff1a1aa49
parent: 4988d317992e59bac97c4e1c86d40fae6bcc24fe
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed May 11 12:59:35 EDT 2016

[cc1] Fix bug after 0fc57e5

0fc57e5 fixed a bug but introduced another one.

--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -304,7 +304,8 @@
 	if (accept(')'))
 		return 0;
 
-	for (n = 0; ; ++n) {
+	n = 0;
+	do {
 		if (n == NR_MACROARG) {
 			cpperror("too much parameters in macro");
 			return NR_MACROARG;
@@ -315,11 +316,9 @@
 		}
 		sym = install(NS_IDEN, yylval.sym);
 		sym->flags |= SUSED;
-		args[n] = sym;
+		args[n++] = sym;
 		next();
-		if (!accept(','))
-			break;
-	}
+	} while (accept(','));
 	expect(')');
 
 	return n;