From 0a4f81e86d21d056329a2b7b2186152e9b9c2375 Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 7 Aug 2022 11:13:51 +0200 Subject: recursive datatypes without forward declaring first --- bootstrap/types.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bootstrap/types.c') 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; } -- cgit v1.2.3