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/vim9execute.c b/src/vim9execute.c
index d2c7d5d..3c23ad4 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -3553,6 +3553,12 @@
{
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);