changeset 23677:94409ebb33f1 v8.2.2380

patch 8.2.2380: Vim9: occasional crash when using try/catch and a timer Commit: https://github.com/vim/vim/commit/a0f7f73ebb3ab032af08699c24c465403512b7d8 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 20 22:22:49 2021 +0100 patch 8.2.2380: Vim9: occasional crash when using try/catch and a timer Problem: Vim9: occasional crash when using try/catch and a timer. Solution: Save and restore "need_rethrow" when invoking a timer callback. (closes #7708)
author Bram Moolenaar <Bram@vim.org>
date Wed, 20 Jan 2021 22:30:04 +0100
parents 268e87b770cd
children 8548a27908be
files src/time.c src/version.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/time.c
+++ b/src/time.c
@@ -478,6 +478,7 @@ check_due_timer(void)
 	    int save_must_redraw = must_redraw;
 	    int save_trylevel = trylevel;
 	    int save_did_throw = did_throw;
+	    int save_need_rethrow = need_rethrow;
 	    int save_ex_pressedreturn = get_pressedreturn();
 	    int save_may_garbage_collect = may_garbage_collect;
 	    except_T *save_current_exception = current_exception;
@@ -493,6 +494,7 @@ check_due_timer(void)
 	    must_redraw = 0;
 	    trylevel = 0;
 	    did_throw = FALSE;
+	    need_rethrow = FALSE;
 	    current_exception = NULL;
 	    may_garbage_collect = FALSE;
 	    save_vimvars(&vvsave);
@@ -513,6 +515,7 @@ check_due_timer(void)
 	    called_emsg = save_called_emsg;
 	    trylevel = save_trylevel;
 	    did_throw = save_did_throw;
+	    need_rethrow = save_need_rethrow;
 	    current_exception = save_current_exception;
 	    restore_vimvars(&vvsave);
 	    if (must_redraw != 0)
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2380,
+/**/
     2379,
 /**/
     2378,