aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lower.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lower.c b/src/lower.c
index ee8253a..880fa0b 100644
--- a/src/lower.c
+++ b/src/lower.c
@@ -1135,6 +1135,10 @@ static int lower_proc(struct state *state, struct ast *proc)
struct ast *block = proc_body(proc);
ret = lower_stmt_list(&new_state, block_body(block), true);
+ /* in case nothing else has returned */
+ indent(&new_state);
+ fprintf(new_state.code, "return stack;\n");
+
fprintf(new_state.code, "}\n\n");
fprintf(new_state.ctx, "};\n\n");