To: vim_dev@googlegroups.com Subject: Patch 8.2.3470 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///