aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/cgen.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-13 13:00:37 +0200
committerlemon <lsof@mailbox.org>2022-08-13 13:00:37 +0200
commita4ddca68662f4bc0531763357b4bc00b6c50b456 (patch)
tree97f83407da049732ec97dd2d32ee34e0cd3c8c0f /bootstrap/cgen.c
parent5b95abb249604e7df9be1d63b1f3dc85b8f5990b (diff)
target
Diffstat (limited to 'bootstrap/cgen.c')
-rw-r--r--bootstrap/cgen.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bootstrap/cgen.c b/bootstrap/cgen.c
index 14f36f1..8b7b710 100644
--- a/bootstrap/cgen.c
+++ b/bootstrap/cgen.c
@@ -146,9 +146,15 @@ geniniex(struct expr *ex) {
for (int i = 0; i < ex->ini.args.n; ++i) {
struct iniarg *arg = &ex->ini.args.d[i];
if (ex->ty->t == TYarr)
- pri("[%I] = %e, ", arg->idx, &arg->ex);
+ if (arg->ex.t == Eini)
+ pri("[%I] = %n, ", arg->idx, &arg->ex);
+ else
+ pri("[%I] = %e, ", arg->idx, &arg->ex);
else
- pri(".%s_ = %e, ", arg->fld, &arg->ex);
+ if (arg->ex.t == Eini)
+ pri(".%s_ = %n, ", arg->fld, &arg->ex);
+ else
+ pri(".%s_ = %e, ", arg->fld, &arg->ex);
}
pri("}");