diff src/vim9execute.c @ 27774:89b1bc6fd40a v8.2.4413

patch 8.2.4413: Vim9: Coverity warns for using NULL pointer Commit: https://github.com/vim/vim/commit/56acd1f8ed4d86e92684f90b3b8e0e9a355208d1 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 18 13:24:52 2022 +0000 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.
author Bram Moolenaar <Bram@vim.org>
date Fri, 18 Feb 2022 14:30:02 +0100
parents b081ba78675a
children 5ce69c07a106
line wrap: on
line diff
--- 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);