summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cgen.c b/cgen.c
index bf2c9c7..cdc16b4 100644
--- a/cgen.c
+++ b/cgen.c
@@ -2085,7 +2085,7 @@ static void cgen_file(CGenerator *g, ParsedFile *f, Typer *tr) {
cgen_write(g, "/* code */\n");
cgen_write(g, "int main(void) {\n");
g->indent_lvl = 1;
- arr_foreach(f->inits, Initialization, init) {
+ arr_foreach(tr->gctx->inits, Initialization, init) {
Statement *s = &init->stmt;
if (s->kind == STMT_EXPR) { /* these wouldn't be generated otherwise */
cgen_expr(g, s->expr);