From bcf5cb0fbf509f0c241e9fa46824aed3f1380a40 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 5 Feb 2011 09:04:11 +0000 Subject: [PATCH] Simplify daisy chaining local labels. [r28309] --- parser.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/parser.c b/parser.c index ce7ce2f..c99427c 100644 --- a/parser.c +++ b/parser.c @@ -10099,8 +10099,9 @@ static statement_t *parse_local_label_declaration(void) eat(T___label__); - entity_t *begin = NULL, *end = NULL; - + entity_t *begin = NULL; + entity_t *end = NULL; + entity_t **anchor = &begin; do { if (token.type != T_IDENTIFIER) { parse_error_expected("while parsing local label declaration", @@ -10120,11 +10121,9 @@ static statement_t *parse_local_label_declaration(void) entity->base.source_position = token.source_position; entity->base.symbol = symbol; - if (end != NULL) - end->base.next = entity; - end = entity; - if (begin == NULL) - begin = entity; + *anchor = entity; + anchor = &entity->base.next; + end = entity; environment_push(entity); } -- 2.20.1