From 2619de52f8cf96064db721583c2e21c062acf230 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Wed, 17 Dec 2008 13:33:15 +0000 Subject: [PATCH] Do not set a non-null last declaration for a declaration statement, if the declaration statement ist empty. [r24749] --- parser.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/parser.c b/parser.c index ab66f35..5c189c2 100644 --- a/parser.c +++ b/parser.c @@ -10582,12 +10582,11 @@ static statement_t *parse_declaration_statement(void) parse_declaration(record_entity, DECL_FLAGS_NONE); } - if (before == NULL) { - statement->declaration.declarations_begin = current_scope->entities; - } else { - statement->declaration.declarations_begin = before->base.next; - } - statement->declaration.declarations_end = current_scope->last_entity; + declaration_statement_t *const decl = &statement->declaration; + entity_t *const begin = + before != NULL ? before->base.next : current_scope->entities; + decl->declarations_begin = begin; + decl->declarations_end = begin != NULL ? current_scope->last_entity : NULL; return statement; } -- 2.20.1