From 3f70fd6c10a2621e346eaa568e838b98fd6ca685 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Fri, 17 Jun 2011 05:45:07 +0200 Subject: [PATCH] Mark a label as used when it is actually used, not later on in the label checker. --- parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parser.c b/parser.c index e51e911..1d068a7 100644 --- a/parser.c +++ b/parser.c @@ -4790,8 +4790,6 @@ static void check_labels(void) continue; label_t *label = goto_statement->label; - - label->used = true; if (label->base.source_position.input_name == NULL) { print_in_function(); errorf(&goto_statement->base.source_position, @@ -9811,7 +9809,9 @@ static statement_t *parse_goto(void) statement->gotos.expression = expression; } else if (token.type == T_IDENTIFIER) { - statement->gotos.label = get_label(); + label_t *const label = get_label(); + label->used = true; + statement->gotos.label = label; } else { if (GNU_MODE) parse_error_expected("while parsing goto", T_IDENTIFIER, '*', NULL); -- 2.20.1