diff options
Diffstat (limited to 'evaluate.c')
| -rw-r--r-- | evaluate.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -866,13 +866,15 @@ static struct symbol *evaluate_dereference(struct expression *expr) struct symbol *ctype = op->ctype, *sym; sym = alloc_symbol(expr->pos, SYM_NODE); - if (ctype->type == SYM_NODE) + sym->ctype = ctype->ctype; + if (ctype->type == SYM_NODE) { ctype = ctype->ctype.base_type; + merge_type(sym, ctype); + } if (ctype->type != SYM_PTR && ctype->type != SYM_ARRAY) { warn(expr->pos, "cannot derefence this type"); return 0; } - sym->ctype = ctype->ctype; ctype = ctype->ctype.base_type; examine_symbol_type(ctype); |
