From: Christoph Mallon Date: Wed, 29 Jun 2011 07:18:27 +0000 (+0200) Subject: Consistently use PUSH_PARENT()/POP_PARENT(). X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=bf92df408b5fef01d5ee065b02c1deb7e4289a5b;p=cparser Consistently use PUSH_PARENT()/POP_PARENT(). This corrects having the wrong parent after parsing an inner function. --- diff --git a/parser.c b/parser.c index f9220f0..2bbdbf4 100644 --- a/parser.c +++ b/parser.c @@ -5491,7 +5491,7 @@ static void parse_external_declaration(void) entity_t *old_current_entity = current_entity; current_function = function; current_entity = entity; - current_parent = NULL; + PUSH_PARENT(NULL); goto_first = NULL; goto_anchor = &goto_first; @@ -5517,7 +5517,7 @@ static void parse_external_declaration(void) } } - assert(current_parent == NULL); + POP_PARENT(); assert(current_function == function); assert(current_entity == entity); current_entity = old_current_entity;