]> granicus.if.org Git - vim/commitdiff
patch 8.2.1927: Vim9: get unknown error with an error in a timer function v8.2.1927
authorBram Moolenaar <Bram@vim.org>
Fri, 30 Oct 2020 19:46:26 +0000 (20:46 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 30 Oct 2020 19:46:26 +0000 (20:46 +0100)
Problem:    Vim9: get unknown error with an error in a timer function.
Solution:   Use did_emsg instead of called_emsg. (closes #7231)

src/version.c
src/vim9compile.c
src/vim9execute.c

index 96a9430fb3096039348c5f7da2aed94abe263794..be975a7b50bc84aecfbbefa136c2ea8703f9f3ce 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1927,
 /**/
     1926,
 /**/
index 225d5d50e600b7b0e3e60ce6fda81d98bea801ee..bc1481dc8457d3fd49589072973defcb9f247525 100644 (file)
@@ -6998,12 +6998,11 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
     char       *errormsg = NULL;       // error message
     cctx_T     cctx;
     garray_T   *instr;
-    int                called_emsg_before = called_emsg;
+    int                did_emsg_before = did_emsg;
     int                ret = FAIL;
     sctx_T     save_current_sctx = current_sctx;
     int                save_estack_compiling = estack_compiling;
     int                do_estack_push;
-    int                emsg_before = called_emsg;
     int                new_def_function = FALSE;
 
     // When using a function that was compiled before: Free old instructions.
@@ -7107,7 +7106,7 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
 
        // Bail out on the first error to avoid a flood of errors and report
        // the right line number when inside try/catch.
-       if (emsg_before != called_emsg)
+       if (did_emsg_before != did_emsg)
            goto erret;
 
        if (line != NULL && *line == '|')
@@ -7127,7 +7126,6 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
                // beyond the last line
                break;
        }
-       emsg_before = called_emsg;
 
        CLEAR_FIELD(ea);
        ea.cmdlinep = &line;
@@ -7585,7 +7583,7 @@ erret:
 
        if (errormsg != NULL)
            emsg(errormsg);
-       else if (called_emsg == called_emsg_before)
+       else if (did_emsg == did_emsg_before)
            emsg(_(e_compiling_def_function_failed));
     }
 
index 9c4665193819072b555f1c43bf37c7b7c095b6b3..abf88b1aef9b3f4532b65130dfbbc902550f4a81 100644 (file)
@@ -828,7 +828,7 @@ call_def_function(
     int                defcount = ufunc->uf_args.ga_len - argc;
     sctx_T     save_current_sctx = current_sctx;
     int                breakcheck_count = 0;
-    int                called_emsg_before = called_emsg;
+    int                did_emsg_before = did_emsg;
     int                save_suppress_errthrow = suppress_errthrow;
     msglist_T  **saved_msg_list = NULL;
     msglist_T  *private_msg_list = NULL;
@@ -853,7 +853,7 @@ call_def_function(
            || (ufunc->uf_def_status == UF_TO_BE_COMPILED
                          && compile_def_function(ufunc, FALSE, NULL) == FAIL))
     {
-       if (called_emsg == called_emsg_before)
+       if (did_emsg == did_emsg_before)
            semsg(_(e_function_is_not_compiled_str),
                                                   printable_func_name(ufunc));
        return FAIL;
@@ -2924,7 +2924,7 @@ failed_early:
     // Not sure if this is necessary.
     suppress_errthrow = save_suppress_errthrow;
 
-    if (ret != OK && called_emsg == called_emsg_before)
+    if (ret != OK && did_emsg == did_emsg_before)
        semsg(_(e_unknown_error_while_executing_str),
                                                   printable_func_name(ufunc));
     return ret;