patch 8.2.2965: Vim9: crash when calling function that failed to compile
Problem: Vim9: crash when calling function that failed to compile.
Solution: Fail when trying to call the function. (closes #8344)
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 28108bf..6fcad3d 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1950,6 +1950,12 @@
PROFILING(ufunc), NULL) == FAIL)
return FAIL;
}
+ if (ufunc->uf_def_status == UF_COMPILE_ERROR)
+ {
+ emsg_funcname(_(e_call_to_function_that_failed_to_compile_str),
+ ufunc->uf_name);
+ return FAIL;
+ }
if ((isn = generate_instr(cctx,
ufunc->uf_def_status != UF_NOT_COMPILED ? ISN_DCALL