aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2009-03-19 22:09:06 +0000
committerChristopher Li <sparse@chrisli.org>2009-07-18 05:30:10 +0000
commitf7e7d7cbad5b04136abbfed66726d99dd84af526 (patch)
treedac371d4168be65eccd230f24e482f138876ae5e /parse.c
parentSanitize pointer() (diff)
downloadsparse-f7e7d7cbad5b04136abbfed66726d99dd84af526.tar.gz
sparse-f7e7d7cbad5b04136abbfed66726d99dd84af526.tar.bz2
sparse-f7e7d7cbad5b04136abbfed66726d99dd84af526.zip
Segfault at evaluate.c:341
On Thu, Mar 19, 2009 at 09:52:50PM +0000, Al Viro wrote: Yeah... It's an old b0rken handling of calls for K&R + changes that exposed that even worse. Status quo is restored by the patch below, but it's a stopgap - e.g. void f(); void g(void) { f(0, 0); } will warn about extra arguments as if we had void f(void); as sparse had been doing all along. B0rken. Testcase for the segfault is void f(x, y); void g(void) { f(0, 0); } Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index e2b47e3..14ae25d 100644
--- a/parse.c
+++ b/parse.c
@@ -2210,6 +2210,7 @@ static struct token *identifier_list(struct token *token, struct symbol *fn)
sym->ident = token->ident;
token = token->next;
sym->endpos = token->pos;
+ sym->ctype.base_type = &incomplete_ctype;
add_symbol(list, sym);
if (!match_op(token, ',') ||
token_type(token->next) != TOKEN_IDENT ||