[hackers] [scc] Woraround to crash in funcdcl() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 28 Jul 2015 07:36:23 +0200 (CEST)

commit 486b07bfc9005abb6f11749d48d07fccd7118ef2
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Jul 28 07:30:31 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Jul 28 07:34:51 2015 +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

diff --git a/cc1/decl.c b/cc1/decl.c
index c16c9ac..7e3c5fd 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -69,7 +69,7 @@ fundcl(struct dcldata *dp)
         expect('(');
 
         n = noname = 0;
- do {
+ if (yytoken != ')') do {
                 if ((sym = parameter()) == NULL) {
                         if (n == 0)
                                 break;
Received on Tue Jul 28 2015 - 07:36:23 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 28 2015 - 07:48:12 CEST