# HG changeset patch # User Bram Moolenaar # Date 1662667204 -7200 # Node ID 6472aa1286515a57fc313e830a077eb56998b3c0 # Parent 3a316f08a3c01f7438ea3149283d8dd1580ce42c patch 9.0.0420: function went missing Commit: https://github.com/vim/vim/commit/c572ad508f53bd89aa29081fc583f17ef1f0f123 Author: Bram Moolenaar Date: Thu Sep 8 20:49:22 2022 +0100 patch 9.0.0420: function went missing Problem: Function went missing. Solution: Add the function back. diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 420, +/**/ 419, /**/ 418, diff --git a/src/vim9cmds.c b/src/vim9cmds.c --- a/src/vim9cmds.c +++ b/src/vim9cmds.c @@ -1685,6 +1685,27 @@ compile_eval(char_u *arg, cctx_T *cctx) } /* + * Get the local variable index for deferred function calls. + * Reserve it when not done already. + * Returns zero for failure. + */ + int +get_defer_var_idx(cctx_T *cctx) +{ + dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data) + + cctx->ctx_ufunc->uf_dfunc_idx; + if (dfunc->df_defer_var_idx == 0) + { + lvar_T *lvar = reserve_local(cctx, (char_u *)"@defer@", 7, + TRUE, &t_list_any); + if (lvar == NULL) + return 0; + dfunc->df_defer_var_idx = lvar->lv_idx + 1; + } + return dfunc->df_defer_var_idx; +} + +/* * Compile "defer func(arg)". */ char_u *