To: vim_dev@googlegroups.com Subject: Patch 8.2.3478 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3478 (after 8.2.3470) Problem: Still crash with error in :catch and also in :finally. Solution: Only call finish_exception() once. (closes #8954) Files: src/ex_eval.c, src/structs.h *** ../vim-8.2.3477/src/ex_eval.c 2021-10-04 18:52:16.008381182 +0100 --- src/ex_eval.c 2021-10-05 11:00:40.240008809 +0100 *************** *** 2401,2408 **** if (!(cstack->cs_flags[idx] & CSF_FINALLY)) { if ((cstack->cs_flags[idx] & CSF_ACTIVE) ! && (cstack->cs_flags[idx] & CSF_CAUGHT)) finish_exception((except_T *)cstack->cs_exception[idx]); // Stop at this try conditional - except the try block never // got active (because of an inactive surrounding conditional // or when the ":try" appeared after an error or interrupt or --- 2401,2412 ---- if (!(cstack->cs_flags[idx] & CSF_FINALLY)) { if ((cstack->cs_flags[idx] & CSF_ACTIVE) ! && (cstack->cs_flags[idx] & CSF_CAUGHT) ! && !(cstack->cs_flags[idx] & CSF_FINISHED)) ! { finish_exception((except_T *)cstack->cs_exception[idx]); + cstack->cs_flags[idx] |= CSF_FINISHED; + } // Stop at this try conditional - except the try block never // got active (because of an inactive surrounding conditional // or when the ":try" appeared after an error or interrupt or *** ../vim-8.2.3477/src/structs.h 2021-09-10 15:58:24.446743066 +0100 --- src/structs.h 2021-10-05 11:04:44.879195260 +0100 *************** *** 943,953 **** # define CSF_CATCH 0x0400 // ":catch" has been seen # define CSF_THROWN 0x0800 // exception thrown to this try conditional # define CSF_CAUGHT 0x1000 // exception caught by this try conditional ! # define CSF_SILENT 0x2000 // "emsg_silent" reset by ":try" // Note that CSF_ELSE is only used when CSF_TRY and CSF_WHILE are unset // (an ":if"), and CSF_SILENT is only used when CSF_TRY is set. ! // ! #define CSF_FUNC_DEF 0x4000 // a function was defined in this block /* * What's pending for being reactivated at the ":endtry" of this try --- 943,954 ---- # define CSF_CATCH 0x0400 // ":catch" has been seen # define CSF_THROWN 0x0800 // exception thrown to this try conditional # define CSF_CAUGHT 0x1000 // exception caught by this try conditional ! # define CSF_FINISHED 0x2000 // CSF_CAUGHT was handled by finish_exception() ! # define CSF_SILENT 0x4000 // "emsg_silent" reset by ":try" // Note that CSF_ELSE is only used when CSF_TRY and CSF_WHILE are unset // (an ":if"), and CSF_SILENT is only used when CSF_TRY is set. ! ! # define CSF_FUNC_DEF 0x8000 // a function was defined in this block /* * What's pending for being reactivated at the ":endtry" of this try *** ../vim-8.2.3477/src/version.c 2021-10-05 01:19:47.077306874 +0100 --- src/version.c 2021-10-05 11:21:53.165441105 +0100 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3478, /**/ -- hundred-and-one symptoms of being an internet addict: 99. The hum of a cooling fan and the click of keys is comforting to you. /// 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 ///