Fix assertion failure introduced in r22072.
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 2 Oct 2008 19:49:19 +0000 (19:49 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 2 Oct 2008 19:49:19 +0000 (19:49 +0000)
[r22422]

parser.c

index 16541f0..3d864ac 100644 (file)
--- 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);