From 56974be882f91c43e2af67dd1c40252cbc189b8b Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 27 Nov 2008 10:01:14 +0000 Subject: [PATCH] don't abort if symbol is NULL in record_declaration [r24039] --- parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parser.c b/parser.c index 0eccfe0..4952bc5 100644 --- a/parser.c +++ b/parser.c @@ -4893,7 +4893,10 @@ static entity_t *record_entity(entity_t *entity, const bool is_definition) const namespace_tag_t namespc = (namespace_tag_t)entity->base.namespc; const source_position_t *pos = &entity->base.source_position; - assert(symbol != NULL); + /* can happen in error cases */ + if (symbol == NULL) + return entity; + entity_t *previous_entity = get_entity(symbol, namespc); /* pushing the same entity twice will break the stack structure */ assert(previous_entity != entity); -- 2.20.1