diff options
-rw-r--r-- | dissect.c | 4 | ||||
-rw-r--r-- | test-dissect.c | 2 |
2 files changed, 4 insertions, 2 deletions
@@ -166,7 +166,7 @@ static inline struct symbol *expr_symbol(struct expression *expr) sym = alloc_symbol(expr->pos, SYM_BAD); bind_symbol(sym, expr->symbol_name, NS_SYMBOL); sym->ctype.modifiers = MOD_EXTERN; - sym->kind = 'v'; + sym->kind = expr->op ?: 'v'; /* see EXPR_CALL */ } } @@ -374,6 +374,8 @@ again: ret = do_expression(mode, expr->cond_false); break; case EXPR_CALL: + if (expr->fn->type == EXPR_SYMBOL) + expr->fn->op = 'f'; /* for expr_symbol() */ ret = do_expression(U_R_PTR, expr->fn); if (is_ptr(ret)) ret = ret->ctype.base_type; diff --git a/test-dissect.c b/test-dissect.c index 81cc89d1..ece22536 100644 --- a/test-dissect.c +++ b/test-dissect.c @@ -55,7 +55,7 @@ static void r_symbol(unsigned mode, struct position *pos, struct symbol *sym) goto err; case 'f': - if (sym->ctype.base_type->type != SYM_FN) + if (sym->type != SYM_BAD && sym->ctype.base_type->type != SYM_FN) goto err; case 'v': if (sym->type == SYM_NODE || sym->type == SYM_BAD) |