aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/cgen.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-10 04:12:33 +0200
committerlemon <lsof@mailbox.org>2022-08-10 04:12:33 +0200
commitb33ee6afa74ab1e83554d1b535d81c7df0b3fca5 (patch)
treed5fb52a1529bf35658468adae796757e664bc792 /bootstrap/cgen.c
parent769aa95cf3374117c86ec652117dcbab97497eec (diff)
many bugfix
Diffstat (limited to 'bootstrap/cgen.c')
-rw-r--r--bootstrap/cgen.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bootstrap/cgen.c b/bootstrap/cgen.c
index 62a808d..4a80bfb 100644
--- a/bootstrap/cgen.c
+++ b/bootstrap/cgen.c
@@ -634,7 +634,11 @@ gendecl(struct decl *decl, bool toplevel) {
case Dlet:
assert(!toplevel);
break;
- case Ddef: case Dtype: case Dtepl: case Dmacro: case Dlabel:
+ case Dtype:
+ if (decl->ty->t == TYstruct || decl->ty->t == TYunion)
+ for (int i = 0; i < decl->ty->agg.decls.n; ++i)
+ liftdecl(decl->ty->agg.decls.d[i]);
+ case Ddef: case Dtepl: case Dmacro: case Dlabel:
break;
}
}
@@ -716,8 +720,6 @@ defctype(const struct type *ty, void *_) {
pri("_Static_assert(__alignof__(%s) == %U, \"__alignof__(%t) == %U\");\n",
*cname, (u64)ty->align, ty, (u64)ty->align);
}
- for (int i = 0; i < ty->agg.decls.n; ++i)
- liftdecl(ty->agg.decls.d[i]);
break;
case TYeunion:
if (ty->konst) {