From 5e8b78ce213f2110343a0a6c10a28a3c6797314e Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sat, 18 Apr 2020 16:37:47 +0200 Subject: scope: __label__ is special Labels declared wth __label__ are special because they must follow the block scope normally used for variables instad of using the scope used for labels. So, use bind_symbol_with_scope() instead of first using bind_symbol() and then changing the namespace. Signed-off-by: Luc Van Oostenryck --- parse.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/parse.c b/parse.c index e23c5b64..29e3f939 100644 --- a/parse.c +++ b/parse.c @@ -2569,8 +2569,7 @@ static struct token *label_statement(struct token *token) while (token_type(token) == TOKEN_IDENT) { struct symbol *sym = alloc_symbol(token->pos, SYM_LABEL); /* it's block-scope, but we want label namespace */ - bind_symbol(sym, token->ident, NS_SYMBOL); - sym->namespace = NS_LABEL; + bind_symbol_with_scope(sym, token->ident, NS_LABEL, block_scope); fn_local_symbol(sym); token = token->next; if (!match_op(token, ',')) -- cgit 1.2.3-korg