From 09ebbe187819f54b514db79c4382c26cda425250 Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 11 Aug 2022 07:41:58 +0200 Subject: finally? --- bootstrap/cgen.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bootstrap') diff --git a/bootstrap/cgen.c b/bootstrap/cgen.c index a00c08f..9053331 100644 --- a/bootstrap/cgen.c +++ b/bootstrap/cgen.c @@ -487,7 +487,8 @@ liftnestedex(struct expr *ex) { liftnestedex(ex->get.lhs); break; case Emcall: - for (int i = 0; i < ex->call.args.n; ++i) + liftdecl(container_of(ex->mcall.met, struct decl, fn)); + for (int i = 0; i < ex->mcall.args.n; ++i) liftnestedex(&ex->mcall.args.d[i]); break; case Eslice: @@ -600,9 +601,12 @@ liftnested(struct stmt *stmt) { } } +static void defctype(const struct type *ty, void *_); + static void genfn(bool externp, const char *cname, struct fn *fn) { liftnested(fn->body); + defctype(fn->retty,NULL); if (!externp) pri("static "); pri("%t %s(", fn->retty, cname); @@ -734,7 +738,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); } - lifttype(ty); break; case TYeunion: if (ty->konst) { @@ -759,7 +762,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); } - lifttype(ty); break; } -- cgit v1.2.3