]> granicus.if.org Git - vim/commitdiff
patch 8.2.2380: Vim9: occasional crash when using try/catch and a timer v8.2.2380
authorBram Moolenaar <Bram@vim.org>
Wed, 20 Jan 2021 21:22:49 +0000 (22:22 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 20 Jan 2021 21:22:49 +0000 (22:22 +0100)
Problem:    Vim9: occasional crash when using try/catch and a timer.
Solution:   Save and restore "need_rethrow" when invoking a timer callback.
            (closes #7708)

src/time.c
src/version.c

index d1cf21b6bc5183d2a4659169cc9362d9dec9a76f..c5ab69305061baeb352e8ac42b344e7e1e6c1ce4 100644 (file)
@@ -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)
index 2e67f32aeedeecdd77955621222439a7e319e585..0e4a97b95608ab2b0a90cc0a9e331088841d3651 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2380,
 /**/
     2379,
 /**/