]> granicus.if.org Git - vim/commitdiff
patch 8.2.4413: Vim9: Coverity warns for using NULL pointer v8.2.4413
authorBram Moolenaar <Bram@vim.org>
Fri, 18 Feb 2022 13:24:52 +0000 (13:24 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 18 Feb 2022 13:24:52 +0000 (13:24 +0000)
Problem:    Vim9: Coverity warns for using NULL pointer.
Solution:   Give an internal error when funcref function can't be found.

src/version.c
src/vim9execute.c

index 9db5ad3b0451f197c5b196830f47005737b76378..cbe988b1cc84990abbdce515f614c365ce4fd2b6 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4413,
 /**/
     4412,
 /**/
index d2c7d5daa8c0d11d61d812eb96faf07e2af7f049..3c23ad41103fa21ab5930a14c6d0f059cce65d3d 100644 (file)
@@ -3553,6 +3553,12 @@ exec_instructions(ectx_T *ectx)
                    {
                        ufunc = find_func(funcref->fr_func_name, FALSE);
                    }
+                   if (ufunc == NULL)
+                   {
+                       SOURCING_LNUM = iptr->isn_lnum;
+                       iemsg("ufunc unexpectedly NULL for FUNCREF");
+                       goto theend;
+                   }
                    if (fill_partial_and_closure(pt, ufunc, ectx) == FAIL)
                        goto theend;
                    tv = STACK_TV_BOT(0);