From: Bram Moolenaar Date: Fri, 18 Feb 2022 13:24:52 +0000 (+0000) Subject: patch 8.2.4413: Vim9: Coverity warns for using NULL pointer X-Git-Tag: v8.2.4413 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56acd1f8ed4d86e92684f90b3b8e0e9a355208d1;p=thirdparty%2Fvim.git patch 8.2.4413: Vim9: Coverity warns for using NULL pointer Problem: Vim9: Coverity warns for using NULL pointer. Solution: Give an internal error when funcref function can't be found. --- diff --git a/src/version.c b/src/version.c index 9db5ad3b04..cbe988b1cc 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 4413, /**/ 4412, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index d2c7d5daa8..3c23ad4110 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -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);