aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/types.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-07 11:13:51 +0200
committerlemon <lsof@mailbox.org>2022-08-07 11:21:42 +0200
commit0a4f81e86d21d056329a2b7b2186152e9b9c2375 (patch)
tree6452e0943a8a81b92aa5a697a8f6b4fb27eb8b1d /bootstrap/types.c
parentf97e08b3da14c79f7f78e439d06988753c79384b (diff)
recursive datatypes without forward declaring first
Diffstat (limited to 'bootstrap/types.c')
-rw-r--r--bootstrap/types.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bootstrap/types.c b/bootstrap/types.c
index 4b4e5be..38d75d0 100644
--- a/bootstrap/types.c
+++ b/bootstrap/types.c
@@ -156,13 +156,12 @@ const struct type *
interntype(struct type ty) {
static int id;
if (!ty.align)
- ty.align = ty.size;
+ ty.align = ty.size ? ty.size : 1;
const struct type *ty2 = typesfind(&ty);
if (ty2)
return ty2;
ty._id = id++;
ty2 = typesput(&ty);
- // epri("new %t, h = %d. %d\n", ty2, hashtype(ty2), ty2->agg.id);
assert(ty2);
return ty2;
}