]> granicus.if.org Git - vim/commitdiff
patch 8.2.4822: setting ufunc to NULL twice v8.2.4822
authorLemonBoy <thatlemon@gmail.com>
Sun, 24 Apr 2022 20:55:00 +0000 (21:55 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 24 Apr 2022 20:55:00 +0000 (21:55 +0100)
Problem:    Setting ufunc to NULL twice.
Solution:   Set ufunc to NULL in find_exported(). (closes #19275)

src/eval.c
src/version.c
src/vim9script.c

index f7445bf40fff467c7ae12e19192ab47354b8da3c..61b09fb6b0cdff50a6f492290553d77db898d073 100644 (file)
@@ -6159,7 +6159,7 @@ handle_subscript(
            char_u      *exp_name;
            int         cc;
            int         idx;
-           ufunc_T     *ufunc = NULL;
+           ufunc_T     *ufunc;
            type_T      *type;
 
            // Found script from "import {name} as name", script item name must
index 36adeb6d6d73097002418b785e5c475064ca1571..612d9e06006a9cbf64e23a070153a647bd7894a4 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4822,
 /**/
     4821,
 /**/
index bb5f0299dc0ccc61e97a2102b6aed80ab241f39f..b1bfe634cb7ef69d7bea6c6928a54419630b857f 100644 (file)
@@ -710,6 +710,8 @@ find_exported(
     svar_T     *sv;
     scriptitem_T *script = SCRIPT_ITEM(sid);
 
+    *ufunc = NULL;
+
     if (script->sn_import_autoload && script->sn_state == SN_STATE_NOT_LOADED)
     {
        if (do_source(script->sn_name, FALSE, DOSO_NONE, NULL) == FAIL)
@@ -724,7 +726,6 @@ find_exported(
     if (idx >= 0)
     {
        sv = ((svar_T *)script->sn_var_vals.ga_data) + idx;
-       *ufunc = NULL;
        if ((sv->sv_flags & SVFLAG_EXPORTED) == 0)
        {
            if (verbose)