0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.2093: Vim9: script test sometimes fails

Problem:    Vim9: script test sometimes fails.
Solution:   Do not find a script variable by its typval if the name was
            cleared.
This commit is contained in:
Bram Moolenaar 2020-12-05 14:44:37 +01:00
parent 2d870f8d9e
commit c0913d023b
2 changed files with 5 additions and 1 deletions

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2093,
/**/
2092,
/**/

View File

@ -741,7 +741,9 @@ find_typval_in_script(typval_T *dest)
{
svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data) + idx;
if (sv->sv_tv == dest)
// If "sv_name" is NULL the variable was hidden when leaving a block,
// don't check "sv_tv" then, it might be used for another variable now.
if (sv->sv_name != NULL && sv->sv_tv == dest)
return sv;
}
iemsg("check_script_var_type(): not found");