Mercurial > vim
diff src/vim9execute.c @ 30192:9f8b1f584395 v9.0.0432
patch 9.0.0432: crash when using for loop variable in closure
Commit: https://github.com/vim/vim/commit/6de2296e5e696b894576d48239aaab0ae84486ff
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 9 21:35:36 2022 +0100
patch 9.0.0432: crash when using for loop variable in closure
Problem: Crash when using for loop variable in closure.
Solution: Check that the variable wasn't deleted. (issue https://github.com/vim/vim/issues/11094)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 09 Sep 2022 22:45:03 +0200 |
parents | 6575d0bf6061 |
children | a970b48c25a3 |
line wrap: on
line diff
--- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -1716,6 +1716,12 @@ get_script_svar(scriptref_T *sref, int d return NULL; } sv = ((svar_T *)si->sn_var_vals.ga_data) + sref->sref_idx; + if (sv->sv_name == NULL) + { + if (dfunc != NULL) + emsg(_(e_script_variable_was_deleted)); + return NULL; + } if (!equal_type(sv->sv_type, sref->sref_type, 0)) { if (dfunc != NULL)