Skip to content

Commit c0913d0

Browse files
committed
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.
1 parent 2d870f8 commit c0913d0

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2093,
753755
/**/
754756
2092,
755757
/**/

src/vim9script.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,9 @@ find_typval_in_script(typval_T *dest)
741741
{
742742
svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data) + idx;
743743

744-
if (sv->sv_tv == dest)
744+
// If "sv_name" is NULL the variable was hidden when leaving a block,
745+
// don't check "sv_tv" then, it might be used for another variable now.
746+
if (sv->sv_name != NULL && sv->sv_tv == dest)
745747
return sv;
746748
}
747749
iemsg("check_script_var_type(): not found");

0 commit comments

Comments
 (0)