[qfcc] Use full type for encoding alias types

This is needed for distinguishing type aliases when only the name
changes.
This commit is contained in:
Bill Currie 2023-06-30 02:42:28 +09:00
parent dc61d15340
commit 7ce475b114
2 changed files with 5 additions and 3 deletions

View File

@ -265,9 +265,9 @@ declare_symbol (specifier_t spec, expr_t *init, symtab_t *symtab)
space = pr.near_data;
}
s->type = append_type (spec.sym->type, spec.type);
//FIXME is_function is bad (this whole implementation of handling
//function prototypes is bad)
s->type = append_type (spec.sym->type, spec.type);
if (spec.is_function && is_func (s->type)) {
set_func_type_attrs (s->type, spec);
}

View File

@ -562,6 +562,7 @@ find_type (type_t *type)
break;
case ty_alias:
type->t.alias.aux_type = find_type (type->t.alias.aux_type);
type->t.alias.full_type = find_type (type->t.alias.full_type);
break;
case ty_handle:
break;
@ -749,8 +750,9 @@ based_array_type (type_t *aux, int base, int top)
new->t.array.type = aux;
new->t.array.base = base;
new->t.array.size = top - base + 1;
if (aux)
if (aux) {
new = find_type (new);
}
return new;
}
@ -1009,7 +1011,7 @@ encode_type (dstring_t *encoding, const type_t *type)
return;
case ty_alias:
dasprintf (encoding, "{%s>", type->name ? type->name : "");
encode_type (encoding, type->t.alias.aux_type);
encode_type (encoding, type->t.alias.full_type);
dasprintf (encoding, "}");
return;
case ty_class: