From 0b1240b79c3a1e4caeb557969d2f3ae59796267f Mon Sep 17 00:00:00 2001 From: Ludovic 'Archivist' Lagouardette Date: Thu, 7 Nov 2024 10:34:57 +0100 Subject: [PATCH] additional cleanup: clean both normally terminated and reusable routines --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.c b/lib.c index f95611a..feed13f 100644 --- a/lib.c +++ b/lib.c @@ -1206,7 +1206,7 @@ void ink_clean_routines(struct context* ctx) { null.value = 0; null.type = INK_INTEGER; for(i = 0; i < ctx->routines_top; ++i) { - if(ctx->routines[i].panic == INK_ROUTINE_CAN_REUSE) { + if(ctx->routines[i].panic == INK_ROUTINE_CAN_REUSE || ctx->routines[i].panic == INK_ROUTINE_SUCCESS) { for (j = 0; j < ctx->routines[i].top; ++j) { ctx->routines[i].stack[j] = null; }