commit f51a68e44b4bb4255a371f30ec95da9282033bd5
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Wed May 11 16:59:35 2016 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Wed May 11 16:59:35 2016 +0200
[cc1] Fix bug after 0fc57e5
0fc57e5 fixed a bug but introduced another one.
diff --git a/cc1/cpp.c b/cc1/cpp.c
index 6d96635..2015b4e 100644
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -304,7 +304,8 @@ getpars(Symbol *args[NR_MACROARG])
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 @@ getpars(Symbol *args[NR_MACROARG])
}
sym = install(NS_IDEN, yylval.sym);
sym->flags |= SUSED;
- args[n] = sym;
+ args[n++] = sym;
next();
- if (!accept(','))
- break;
- }
+ } while (accept(','));
expect(')');
return n;