1
0
forked from aniani/vim

patch 8.2.4612: Vim9: cannot use a recursive call in a nested function

Problem:    Vim9: cannot use a recursive call in a nested function. (Sergey
            Vlasov)
Solution:   Define the funcref before compiling the function. (closes #9989)
This commit is contained in:
Bram Moolenaar
2022-03-23 11:29:15 +00:00
parent 81b573d7e5
commit a915fa0103
6 changed files with 52 additions and 21 deletions

View File

@@ -1040,7 +1040,7 @@ compile_lambda(char_u **arg, cctx_T *cctx)
// The function reference count will be 1. When the ISN_FUNCREF
// instruction is deleted the reference count is decremented and the
// function is freed.
return generate_FUNCREF(cctx, ufunc);
return generate_FUNCREF(cctx, ufunc, NULL);
}
func_ptr_unref(ufunc);