0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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)
This commit is contained in:
Bram Moolenaar
2022-02-07 19:56:43 +00:00
parent 92368aad61
commit 7aca5ca676
6 changed files with 54 additions and 5 deletions

View File

@@ -4526,6 +4526,9 @@ partial_free(partial_T *pt)
// "out_up" is no longer used, decrement refcount on partial that owns it.
partial_unref(pt->pt_outer.out_up_partial);
// Using pt_outer from another partial.
partial_unref(pt->pt_outer_partial);
// Decrease the reference count for the context of a closure. If down
// to the minimum it may be time to free it.
if (pt->pt_funcstack != NULL)