1
0
forked from aniani/vim

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

@@ -4456,7 +4456,10 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
}
if (arg_pt != NULL)
pt->pt_outer = arg_pt->pt_outer;
{
pt->pt_outer_partial = arg_pt;
++arg_pt->pt_refcount;
}
}
rettv->v_type = VAR_PARTIAL;
rettv->vval.v_partial = pt;