From: Matthias Braun Date: Fri, 30 May 2008 08:57:39 +0000 (+0000) Subject: make parser more robust against invalid declarations X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=4b8050e8505b69523994ff0fa0bc5681dc44b58b;p=cparser make parser more robust against invalid declarations [r19829] --- diff --git a/parser.c b/parser.c index 28b6d2c..cb06856 100644 --- a/parser.c +++ b/parser.c @@ -3692,6 +3692,7 @@ static declaration_t *parse_declarator( if(construct_type != NULL) { obstack_free(&temp_obst, construct_type); + declaration->valid = true; } return declaration; @@ -3788,6 +3789,9 @@ static declaration_t *internal_record_declaration( const symbol_t *const symbol = declaration->symbol; const namespace_t namespc = (namespace_t)declaration->namespc; + if (!declaration->valid) + return declaration; + type_t *const orig_type = declaration->type; type_t *const type = skip_typeref(orig_type); if (is_type_function(type) &&