patch 8.2.4322: Vim9: crash when using funcref with closure
Problem: Vim9: crash when using funcref with closure.
Solution: Keep a reference to the funcref that has the outer context.
(closes #9716)
diff --git a/src/structs.h b/src/structs.h
index ecab354..1e759f5 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -2051,6 +2051,9 @@
// For a compiled closure: the arguments and local variables scope
outer_T pt_outer;
+ // For a partial of a partial: use pt_outer values of this partial.
+ partial_T *pt_outer_partial;
+
funcstack_T *pt_funcstack; // copy of stack, used after context
// function returns