patch 8.2.1778: Vim9: returning from a partial call clears outer context
Problem: Vim9: returning from a partial call clears outer context, causing
a crash.
Solution: Put the outer context in the stack frame. (closes #7044)
diff --git a/src/vim9.h b/src/vim9.h
index a39fbbb..663faa6 100644
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -326,10 +326,12 @@
};
// Number of entries used by stack frame for a function call.
-// - function index
-// - instruction index
-// - previous frame index
-#define STACK_FRAME_SIZE 3
+// - ec_dfunc_idx: function index
+// - ec_iidx: instruction index
+// - ec_outer_stack: stack used for closures TODO: can we avoid this?
+// - ec_outer_frame: stack frame for closures
+// - ec_frame_idx: previous frame index
+#define STACK_FRAME_SIZE 5
#ifdef DEFINE_VIM9_GLOBALS