comparison 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
comparison
equal deleted inserted replaced
30191:f272acee7477 30192:9f8b1f584395
1714 semsg(_(e_script_variable_invalid_after_reload_in_function_str), 1714 semsg(_(e_script_variable_invalid_after_reload_in_function_str),
1715 printable_func_name(dfunc->df_ufunc)); 1715 printable_func_name(dfunc->df_ufunc));
1716 return NULL; 1716 return NULL;
1717 } 1717 }
1718 sv = ((svar_T *)si->sn_var_vals.ga_data) + sref->sref_idx; 1718 sv = ((svar_T *)si->sn_var_vals.ga_data) + sref->sref_idx;
1719 if (sv->sv_name == NULL)
1720 {
1721 if (dfunc != NULL)
1722 emsg(_(e_script_variable_was_deleted));
1723 return NULL;
1724 }
1719 if (!equal_type(sv->sv_type, sref->sref_type, 0)) 1725 if (!equal_type(sv->sv_type, sref->sref_type, 0))
1720 { 1726 {
1721 if (dfunc != NULL) 1727 if (dfunc != NULL)
1722 emsg(_(e_script_variable_type_changed)); 1728 emsg(_(e_script_variable_type_changed));
1723 return NULL; 1729 return NULL;