Patch 8.2.3470
Problem: Crash with error in :catch and also in :finally.
Solution: Only discard an exception if there is one. (closes #8954)
Files: src/ex_eval.c, src/testdir/test_trycatch.vim
*** ../vim-8.2.3469/src/ex_eval.c 2021-08-25 21:37:33.103295301 +0100
--- src/ex_eval.c 2021-10-04 18:47:14.236186898 +0100
***************
*** 2374,2380 ****
default:
if (cstack->cs_flags[idx] & CSF_FINALLY)
{
! if (cstack->cs_pending[idx] & CSTP_THROW)
{
// Cancel the pending exception. This is in the
// finally clause, so that the stack of the
--- 2374,2381 ----
default:
if (cstack->cs_flags[idx] & CSF_FINALLY)
{
! if ((cstack->cs_pending[idx] & CSTP_THROW)
! && cstack->cs_exception[idx] != NULL)
{
// Cancel the pending exception. This is in the
// finally clause, so that the stack of the
*** ../vim-8.2.3469/src/testdir/test_trycatch.vim 2021-09-18
14:25:49.272973758 +0100
--- src/testdir/test_trycatch.vim 2021-10-04 18:36:57.731721984 +0100
***************
*** 2273,2278 ****
--- 2273,2290 ----
call delete('XtestThrow')
endfunc
+ func ThisWillFail()
+ try
+ if x | endif
+ catch
+ for l in []
+ finally
+ endfunc
+
+ func Test_error_in_catch_and_finally()
+ call assert_fails('call ThisWillFail()', ['E121:', 'E600:'])
+ endfunc
+
" Modeline {{{1
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
*** ../vim-8.2.3469/src/version.c 2021-10-03 20:11:16.684302935 +0100
--- src/version.c 2021-10-04 18:24:22.569443057 +0100
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3470,
/**/
--
>From "know your smileys":
|-( Contact lenses, but has lost them
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20211004175255.835B7C80053%40pakwach.