scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 486b07bfc9005abb6f11749d48d07fccd7118ef2
parent e7ca69b68ebc64e8bea02198105838ac8726e528
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 28 Jul 2015 07:30:31 +0200

Woraround to crash in funcdcl()

funcdcl() crash with a declaration like f() because the 'default int'
rule was generating a integer type which didn't match any parameter.
This commit fix the problem detecting it.

This is only a workaround until I rewrite decl.c

Diffstat:
Mcc1/decl.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -69,7 +69,7 @@ fundcl(struct dcldata *dp) expect('('); n = noname = 0; - do { + if (yytoken != ')') do { if ((sym = parameter()) == NULL) { if (n == 0) break;