1
0
forked from aniani/vim

patch 8.2.4321: Vim9: crash when using a funcref to a closure

Problem:    Vim9: crash when using a funcref to a closure.
Solution:   Copy pt_outer to the new partial. (closes #9714)
This commit is contained in:
Bram Moolenaar
2022-02-07 17:50:39 +00:00
parent 28f1a51bde
commit 92368aad61
3 changed files with 27 additions and 0 deletions

View File

@@ -4454,6 +4454,9 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
pt->pt_name = name;
func_ref(name);
}
if (arg_pt != NULL)
pt->pt_outer = arg_pt->pt_outer;
}
rettv->v_type = VAR_PARTIAL;
rettv->vval.v_partial = pt;