summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'types.c')
-rw-r--r--types.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/types.c b/types.c
index 486dac5..e744fb7 100644
--- a/types.c
+++ b/types.c
@@ -1930,7 +1930,8 @@ static bool types_block(Typer *tr, Block *b) {
success = false;
goto ret;
}
- b->ret_expr = e;
+ b->ret_expr = typer_malloc(tr, sizeof *b->ret_expr);
+ *b->ret_expr = *e;
arr_remove_lasta(&b->stmts, tr->allocr);
}
}