Skip to content

Commit c572ad5

Browse files
committed
patch 9.0.0420: function went missing
Problem: Function went missing. Solution: Add the function back.
1 parent 1690032 commit c572ad5

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,8 @@ static char *(features[]) =
703703

704704
static int included_patches[] =
705705
{ /* Add new patch number below this line */
706+
/**/
707+
420,
706708
/**/
707709
419,
708710
/**/

src/vim9cmds.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,27 @@ compile_eval(char_u *arg, cctx_T *cctx)
16841684
return skipwhite(p);
16851685
}
16861686

1687+
/*
1688+
* Get the local variable index for deferred function calls.
1689+
* Reserve it when not done already.
1690+
* Returns zero for failure.
1691+
*/
1692+
int
1693+
get_defer_var_idx(cctx_T *cctx)
1694+
{
1695+
dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data)
1696+
+ cctx->ctx_ufunc->uf_dfunc_idx;
1697+
if (dfunc->df_defer_var_idx == 0)
1698+
{
1699+
lvar_T *lvar = reserve_local(cctx, (char_u *)"@defer@", 7,
1700+
TRUE, &t_list_any);
1701+
if (lvar == NULL)
1702+
return 0;
1703+
dfunc->df_defer_var_idx = lvar->lv_idx + 1;
1704+
}
1705+
return dfunc->df_defer_var_idx;
1706+
}
1707+
16871708
/*
16881709
* Compile "defer func(arg)".
16891710
*/

0 commit comments

Comments
 (0)