From 14ac77bf8de805f3a6a9d162ef222afe38f04e8d Mon Sep 17 00:00:00 2001 From: Ludovic 'Archivist' Lagouardette Date: Thu, 7 Nov 2024 10:32:33 +0100 Subject: [PATCH] additional cleanup: removing function stack elements too --- lib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib.c b/lib.c index cb7e14d..f95611a 100644 --- a/lib.c +++ b/lib.c @@ -1210,7 +1210,12 @@ void ink_clean_routines(struct context* ctx) { for (j = 0; j < ctx->routines[i].top; ++j) { ctx->routines[i].stack[j] = null; } + for (j = 0; j < ctx->routines[i].function_stack_top; ++j) { + ctx->routines[i].function_stack[j].executing = null; + ctx->routines[i].function_stack[j].index = 0; + } ctx->routines[i].top = 0; + ctx->routines[i].function_stack_top = 0; } } }