aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2026-02-26 00:02:04 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2026-02-26 00:16:06 +0200
commit98bfec2266ee751011cb3cd475f462393e976724 (patch)
treecd610476341ae35bc714f0925b159f4fe07e3207
parent0dd32cca3b8ad7e2a34ec815996e68e2f81c1da1 (diff)
downloadfwd-98bfec2266ee751011cb3cd475f462393e976724.tar.gz
fwd-98bfec2266ee751011cb3cd475f462393e976724.zip
add fallback return path
-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");