diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-10-06 22:08:11 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-06 22:08:11 +0100 |
commit | cce81e9673fe8d056e8eef310d9919620eccb2f2 (patch) | |
tree | 2899b652b178f018a5032bd0ad6d5248462843da /src/testdir/test_trycatch.vim | |
parent | edd7a476fbcba199dc0b026461917912c574c629 (diff) | |
download | vim-git-cce81e9673fe8d056e8eef310d9919620eccb2f2.tar.gz |
patch 8.2.3486: illegal memory access with invalid sequence of commandsv8.2.3486
Problem: Illegal memory access with invalid sequence of commands.
Solution: Do not call leave_block() when not in a try block. (closes #8966)
Reset did_emsg so that exception is shown as an error.
Diffstat (limited to 'src/testdir/test_trycatch.vim')
-rw-r--r-- | src/testdir/test_trycatch.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_trycatch.vim b/src/testdir/test_trycatch.vim index 4b8f7efbd..50c1c65f2 100644 --- a/src/testdir/test_trycatch.vim +++ b/src/testdir/test_trycatch.vim @@ -2295,5 +2295,25 @@ func Test_error_in_catch_and_finally() call delete('XtestCatchAndFinally') endfunc +" This was causing an illegal memory access +func Test_leave_block_in_endtry_not_called() + let lines =<< trim END + vim9script + try # + for x in [] + if + endwhile + if + endtry + END + call writefile(lines, 'XtestEndtry') + try + source XtestEndtry + catch /E171:/ + endtry + + call delete('XtestEndtry') +endfunc + " Modeline {{{1 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |