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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user