aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-03 20:53:43 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-12-03 21:21:47 +0800
commit0cb90114d4c4801457e286c9b72ad0f394877d05 (patch)
tree846f82101d13a45c8c5faf26971472ea880af4ea /src/nvim/testdir
parentbf4bf7f9e034ca2262e53e347ecb87054aa688d7 (diff)
downloadrneovim-0cb90114d4c4801457e286c9b72ad0f394877d05.tar.gz
rneovim-0cb90114d4c4801457e286c9b72ad0f394877d05.tar.bz2
rneovim-0cb90114d4c4801457e286c9b72ad0f394877d05.zip
vim-patch:9.0.0577: buffer underflow with unexpected :finally
Problem: Buffer underflow with unexpected :finally. Solution: Check CSF_TRY can be found. https://github.com/vim/vim/commit/96b9bf8f74af8abf1e30054f996708db7dc285be Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_trycatch.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_trycatch.vim b/src/nvim/testdir/test_trycatch.vim
index 8a1d2d3fa7..ef20e03126 100644
--- a/src/nvim/testdir/test_trycatch.vim
+++ b/src/nvim/testdir/test_trycatch.vim
@@ -3,6 +3,7 @@
source check.vim
source shared.vim
+source vim9.vim
"-------------------------------------------------------------------------------
" Test environment {{{1
@@ -2007,6 +2008,27 @@ func Test_try_catch_errors()
call assert_fails('try | for i in range(5) | endif | endtry', 'E580:')
call assert_fails('try | while v:true | endtry', 'E170:')
call assert_fails('try | if v:true | endtry', 'E171:')
+
+ " this was using a negative index in cstack[]
+ let lines =<< trim END
+ try
+ for
+ if
+ endwhile
+ if
+ finally
+ END
+ call CheckScriptFailure(lines, 'E690:')
+
+ let lines =<< trim END
+ try
+ for
+ if
+ endwhile
+ if
+ endtry
+ END
+ call CheckScriptFailure(lines, 'E690:')
endfunc
" Test for verbose messages with :try :catch, and :finally {{{1