mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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 #11094)
This commit is contained in:
@@ -1716,6 +1716,12 @@ get_script_svar(scriptref_T *sref, int dfunc_idx)
|
||||
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)
|
||||
|
Reference in New Issue
Block a user