From a59923a9f79074f790cfea6dd264e9492d3516e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Wed, 25 Sep 1996 03:38:02 +0200
Subject: [PATCH] gc_on F_RETURN if switch > 0

Rev: src/interpret.c:1.4
---
 src/interpret.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/interpret.c b/src/interpret.c
index 21e8fc6a94..0501236b48 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -875,7 +875,8 @@ static void eval_instruction(unsigned char *pc)
 
       CASE(F_RETURN_0);
       pop_n_elems(sp-fp->locals);
-      return;
+      push_int(0);
+      goto do_return;
 
       CASE(F_RETURN);
       if(fp->locals != sp-1)
@@ -883,6 +884,13 @@ static void eval_instruction(unsigned char *pc)
 	assign_svalue(fp->locals, sp-1);
 	pop_n_elems(sp - fp->locals - 1);
       }
+
+    do_return:
+#if defined(DEBUG) && defined(GC2)
+      if(d_flag > 2) do_gc();
+      check_signals();
+#endif
+
       /* fall through */
 
       CASE(F_DUMB_RETURN);
-- 
GitLab