diff options
Diffstat (limited to 'expression.c')
-rw-r--r-- | expression.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/expression.c b/expression.c index 5b9bddfe..99a6d756 100644 --- a/expression.c +++ b/expression.c @@ -71,9 +71,9 @@ struct token *parens_expression(struct token *token, struct expression **expr, c struct statement *stmt = alloc_statement(token->pos, STMT_COMPOUND); *expr = e; e->statement = stmt; - start_symbol_scope(); + start_label_scope(); token = compound_statement(token->next, stmt); - end_symbol_scope(); + end_label_scope(); token = expect(token, '}', "at end of statement expression"); } else token = parse_expression(token, expr); @@ -124,9 +124,8 @@ static struct symbol *handle_func(struct token *token) decl->ctype.modifiers = MOD_STATIC; decl->endpos = token->pos; - /* function-scope, but in NS_SYMBOL */ - bind_symbol(decl, ident, NS_LABEL); - decl->namespace = NS_SYMBOL; + /* NS_SYMBOL but in function-scope */ + bind_symbol_with_scope(decl, ident, NS_SYMBOL, function_scope); len = current_fn->ident->len; string = __alloc_string(len + 1); @@ -687,11 +686,12 @@ static struct token *unary_expression(struct token *token, struct expression **t if (match_op(token, SPECIAL_LOGICAL_AND) && token_type(token->next) == TOKEN_IDENT) { struct expression *label = alloc_expression(token->pos, EXPR_LABEL); - struct symbol *sym = label_symbol(token->next); + struct symbol *sym = label_symbol(token->next, 1); if (!(sym->ctype.modifiers & MOD_ADDRESSABLE)) { sym->ctype.modifiers |= MOD_ADDRESSABLE; add_symbol(&function_computed_target_list, sym); } + check_label_usage(sym, token->pos); label->flags = CEF_ADDR; label->label_symbol = sym; *tree = label; |