]> granicus.if.org Git - vim/commitdiff
patch 8.2.2093: Vim9: script test sometimes fails v8.2.2093
authorBram Moolenaar <Bram@vim.org>
Sat, 5 Dec 2020 13:44:37 +0000 (14:44 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 5 Dec 2020 13:44:37 +0000 (14:44 +0100)
Problem:    Vim9: script test sometimes fails.
Solution:   Do not find a script variable by its typval if the name was
            cleared.

src/version.c
src/vim9script.c

index 6f242ff8536a1c853e7464d1db889071efd54a16..b28638b44692e9626b2a9ae48cbf8296c3317109 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2093,
 /**/
     2092,
 /**/
index 378035660d2b2a5d17fc681b7b6a877f0f5e8cc6..fa455ab191604494dac59ff32284f5018b83ccb6 100644 (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");