diff options
Diffstat (limited to 'bootstrap/types.c')
| -rw-r--r-- | bootstrap/types.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/bootstrap/types.c b/bootstrap/types.c index dce85a6..788f001 100644 --- a/bootstrap/types.c +++ b/bootstrap/types.c @@ -180,6 +180,7 @@ uninterntype(const struct type *key) { } else { types.buckets[idx] = n->next; } + typesvec.data[key->_id] = NULL; free(n); break; } @@ -189,6 +190,7 @@ uninterntype(const struct type *key) { bool completetype(const struct type *ty) { + if (ty->konst) return completetype(unconstify(ty)); if (ty->t == TYvoid) return 0; if (ty->t == TYfn) @@ -241,10 +243,10 @@ putprimtypes(struct env *env) { {"iptrint", &ty_iptrint, {TYint, t.ptrsize, IS}}, {"uptrint", &ty_uptrint, {TYint, t.ptrsize, IU}}, {"c_char", &ty_c_char, {TYint, 1, .int_signed = t.charsigned}}, - {"c_long", &ty_c_long, {TYint, t.longsize, IS}}, - {"c_ulong", &ty_c_ulong, {TYint, t.longsize, IU}}, - {"c_llong", &ty_c_llong, {TYint, t.llongsize, IS}}, - {"c_ullong", &ty_c_ullong, {TYint, t.llongsize, IU}}, + {"c_long", &ty_c_long, {TYint, t.longsize, t.longalign, IS}}, + {"c_ulong", &ty_c_ulong, {TYint, t.longsize, t.longalign, IU}}, + {"c_llong", &ty_c_llong, {TYint, t.llongsize, t.llongalign, IS}}, + {"c_ullong", &ty_c_ullong, {TYint, t.llongsize, t.llongalign, IU}}, {"va_list", &ty_valist, {TYvalist, t.valistsize, t.valistalign}}, #undef IS #undef IU @@ -265,8 +267,10 @@ putprimtypes(struct env *env) { void visittypes(void (*visitor)(const struct type *, void *), void *arg) { int i; const struct type *ty; - vec_foreach(&typesvec, ty, i) - visitor(ty, arg); + vec_foreach(&typesvec, ty, i) { + if (ty) + visitor(ty, arg); + } } const struct type * |