diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-01-27 21:37:13 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-01-27 21:37:13 +0100 |
commit | 3e492c2d5fbd4ae395ffddfc059a3c414604b951 (patch) | |
tree | 01380adbcad261168159d8f0ca86cd00142dc1af /src/ex_eval.c | |
parent | bed72df3e61a8908ed6324212595118f305dded0 (diff) | |
download | vim-git-3e492c2d5fbd4ae395ffddfc059a3c414604b951.tar.gz |
patch 8.2.2417: condition stack values may be used when not setv8.2.2417
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)
Diffstat (limited to 'src/ex_eval.c')
-rw-r--r-- | src/ex_eval.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ex_eval.c b/src/ex_eval.c index 94338fcdb..ad9de26db 100644 --- 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 |