mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
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:
@@ -1172,9 +1172,10 @@ generate_NEWDICT(cctx_T *cctx, int count)
|
||||
|
||||
/*
|
||||
* Generate an ISN_FUNCREF instruction.
|
||||
* "isnp" is set to the instruction, so that fr_dfunc_idx can be set later.
|
||||
*/
|
||||
int
|
||||
generate_FUNCREF(cctx_T *cctx, ufunc_T *ufunc)
|
||||
generate_FUNCREF(cctx_T *cctx, ufunc_T *ufunc, isn_T **isnp)
|
||||
{
|
||||
isn_T *isn;
|
||||
type_T *type;
|
||||
@@ -1182,6 +1183,8 @@ generate_FUNCREF(cctx_T *cctx, ufunc_T *ufunc)
|
||||
RETURN_OK_IF_SKIP(cctx);
|
||||
if ((isn = generate_instr(cctx, ISN_FUNCREF)) == NULL)
|
||||
return FAIL;
|
||||
if (isnp != NULL)
|
||||
*isnp = isn;
|
||||
if (ufunc->uf_def_status == UF_NOT_COMPILED)
|
||||
isn->isn_arg.funcref.fr_func_name = vim_strsave(ufunc->uf_name);
|
||||
else
|
||||
|
Reference in New Issue
Block a user