changeset 23752:7425d3e5804e v8.2.2417

patch 8.2.2417: condition stack values may be used when not set Commit: https://github.com/vim/vim/commit/3e492c2d5fbd4ae395ffddfc059a3c414604b951 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 27 21:37:13 2021 +0100 patch 8.2.2417: condition stack values may be used when not set 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)
author Bram Moolenaar <Bram@vim.org>
date Wed, 27 Jan 2021 21:45:03 +0100
parents 134485c14630
children b7ab2ae790cc
files src/ex_eval.c src/version.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2417,
+/**/
     2416,
 /**/
     2415,