diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-02-07 19:56:43 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-07 19:56:43 +0000 |
commit | 7aca5ca6763e50d2c23953b20e30fca7457c9abf (patch) | |
tree | a0a1e5077975c095e06f37b668baff7f68a92230 /src/eval.c | |
parent | 92368aad613bca700877ccb1725e1cb5a80dd34a (diff) | |
download | vim-git-7aca5ca6763e50d2c23953b20e30fca7457c9abf.tar.gz |
patch 8.2.4322: Vim9: crash when using funcref with closurev8.2.4322
Problem: Vim9: crash when using funcref with closure.
Solution: Keep a reference to the funcref that has the outer context.
(closes #9716)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index 7ab05be12..2942d0fe1 100644 --- a/src/eval.c +++ b/src/eval.c @@ -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) |