From 53152e70e6ef7b78379ed42b6e2d0d96c2521ec4 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Mon, 25 Aug 2008 08:08:13 +0000 Subject: [PATCH] Do not dereference a NULL-pointer when there is no declaration while parsing an inner declarator. [r21430] --- parser.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index e640591..4007c8f 100644 --- a/parser.c +++ b/parser.c @@ -3773,7 +3773,7 @@ static construct_type_t *parse_inner_declarator(declaration_t *declaration, construct_type_t *last = NULL; gnu_attribute_t *attributes = NULL; - declaration->modifiers |= parse_attributes(&attributes); + decl_modifiers_t modifiers = parse_attributes(&attributes); /* pointers */ while (token.type == '*') { @@ -3788,9 +3788,12 @@ static construct_type_t *parse_inner_declarator(declaration_t *declaration, } /* TODO: find out if this is correct */ - declaration->modifiers |= parse_attributes(&attributes); + modifiers |= parse_attributes(&attributes); } + if (declaration != NULL) + declaration->modifiers |= modifiers; + construct_type_t *inner_types = NULL; switch(token.type) { -- 2.20.1