diff options
-rw-r--r-- | dissect.c | 4 | ||||
-rw-r--r-- | dissect.h | 3 |
2 files changed, 4 insertions, 3 deletions
@@ -152,7 +152,6 @@ static inline struct symbol *expr_symbol(struct expression *expr) if (!sym) { sym = alloc_symbol(expr->pos, SYM_BAD); bind_symbol(sym, expr->symbol_name, NS_SYMBOL); - sym->ctype.modifiers = MOD_EXTERN | MOD_TOPLEVEL; sym->kind = expr->op ?: 'v'; /* see EXPR_CALL */ } } @@ -238,7 +237,8 @@ static void examine_sym_node(struct symbol *node, struct symbol *parent) return; dctx = dissect_ctx; - dissect_ctx = NULL; + if (toplevel(base->scope)) + dissect_ctx = NULL; if (base->ident || deanon(base, name, parent)) reporter->r_symdef(base); @@ -4,6 +4,7 @@ #include <stdio.h> #include "parse.h" #include "expression.h" +#include "scope.h" #define U_SHIFT 8 @@ -29,7 +30,7 @@ extern struct symbol *dissect_ctx; static inline bool sym_is_local(struct symbol *sym) { - return sym->kind == 'v' && !(sym->ctype.modifiers & MOD_TOPLEVEL); + return !toplevel(sym->scope); } extern void dissect(struct reporter *, struct string_list *); |