]> granicus.if.org Git - vim/commitdiff
patch 8.2.2417: condition stack values may be used when not set v8.2.2417
authorBram Moolenaar <Bram@vim.org>
Wed, 27 Jan 2021 20:37:13 +0000 (21:37 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 27 Jan 2021 20:37:13 +0000 (21:37 +0100)
Problem:    Condition stack values may be used when not set.
Solution:   Clear cs_script_var_len and cs_block_id just in case they get used
            later. (issue #7733)

src/ex_eval.c
src/version.c

index 94338fcdb2c60aad68dd791fc39e30796d793eff..ad9de26dbe2f6a02e2cb6936e12470f05232fb56 100644 (file)
@@ -920,6 +920,13 @@ enter_block(cstack_T *cstack)
        cstack->cs_block_id[cstack->cs_idx] = ++si->sn_last_block_id;
        si->sn_current_block_id = si->sn_last_block_id;
     }
+    else
+    {
+       // Just in case in_vim9script() does not return the same value when the
+       // block ends.
+       cstack->cs_script_var_len[cstack->cs_idx] = 0;
+       cstack->cs_block_id[cstack->cs_idx] = 0;
+    }
 }
 
     static void
index 17ca2717d98b8ae32a3c9fd2e491f37aca039921..d9d8104afe7f19fb4a06fb482afeceb397a4d93b 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2417,
 /**/
     2416,
 /**/