Fix r23702 and r23704.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sun, 16 Nov 2008 10:30:35 +0000 (10:30 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sun, 16 Nov 2008 10:30:35 +0000 (10:30 +0000)
[r23705]

parser.c

index 417b1e2..d5a31ad 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -5272,8 +5272,6 @@ static void check_labels(void)
                               "label '%Y' used but not defined", label->base.symbol);
                 }
        }
-       goto_first  = NULL;
-       goto_anchor = &goto_first;
 
        if (warning.unused_label) {
                for (const label_statement_t *label_statement = label_first;
@@ -5288,8 +5286,6 @@ static void check_labels(void)
                        }
                }
        }
-       label_first  = NULL;
-       label_anchor = &label_first;
 }
 
 static void warn_unused_decl(entity_t *entity, entity_t *end,
@@ -5970,7 +5966,12 @@ static void parse_external_declaration(void)
                current_function                 = function;
                current_parent                   = NULL;
 
-               statement_t *const body     = parse_compound_statement(false);
+               goto_first   = NULL;
+               goto_anchor  = &goto_first;
+               label_first  = NULL;
+               label_anchor = &label_first;
+
+               statement_t *const body = parse_compound_statement(false);
                function->statement = body;
                first_err = true;
                check_labels();