From c03b67f44cf5f7f19449a6f2d81ce211412b0faf Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Fri, 5 Dec 2008 10:43:19 +0000 Subject: [PATCH] One more declaration-with-no-declarators-null-pointer fix. [r24313] --- parser.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/parser.c b/parser.c index d23d7bf..6a25323 100644 --- a/parser.c +++ b/parser.c @@ -6215,13 +6215,15 @@ static void check_unreachable(statement_t* const stmt, void *const env) declaration_statement_t const *const decl = &stmt->declaration; entity_t const * ent = decl->declarations_begin; entity_t const *const last = decl->declarations_end; - for (;; ent = ent->base.next) { - if (ent->kind == ENTITY_VARIABLE && - ent->variable.initializer != NULL) { - goto warn_unreachable; + if (ent != NULL) { + for (;; ent = ent->base.next) { + if (ent->kind == ENTITY_VARIABLE && + ent->variable.initializer != NULL) { + goto warn_unreachable; + } + if (ent == last) + return; } - if (ent == last) - return; } } -- 2.20.1