From: Christoph Mallon Date: Thu, 2 Oct 2008 19:49:19 +0000 (+0000) Subject: Fix assertion failure introduced in r22072. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=46e601cdf52e685ab226cdb0eac8799107b3f77e;p=cparser Fix assertion failure introduced in r22072. [r22422] --- diff --git a/parser.c b/parser.c index 16541f0..3d864ac 100644 --- a/parser.c +++ b/parser.c @@ -842,10 +842,14 @@ static void stack_pop_to(stack_entry_t **stack_ptr, size_t new_top) break; } - /* Because of scopes and appending other namespaces to the end of - * the list, this must hold. */ - assert((old_declaration != NULL ? old_declaration->symbol_next : NULL) == iter->symbol_next); - *anchor = old_declaration; + /* Not all declarations adhere scopes (e.g. jump labels), so this + * correction is necessary */ + if (old_declaration != NULL) { + old_declaration->symbol_next = iter->symbol_next; + *anchor = old_declaration; + } else { + *anchor = iter->symbol_next; + } } ARR_SHRINKLEN(*stack_ptr, (int) new_top);