Problem: Vim9: crash when calling function that failed to compile.
Solution: Fail when trying to call the function. (closes #8344)
INIT(= N_("E1190: One argument too few"));
EXTERN char e_nr_arguments_too_few[]
INIT(= N_("E1190: %d arguments too few"));
+EXTERN char e_call_to_function_that_failed_to_compile_str[]
+ INIT(= N_("E1191: Call to function that failed to compile: %s"));
delete('Xdir', 'rf')
enddef
+def Test_compile_error_in_called_function()
+ var lines =<< trim END
+ vim9script
+ var n: number
+ def Foo()
+ &hls = n
+ enddef
+ def Bar()
+ Foo()
+ enddef
+ silent! Foo()
+ Bar()
+ END
+ CheckScriptFailureList(lines, ['E1012:', 'E1191:'])
+enddef
+
def Test_autoload_name_mismatch()
var dir = 'Xdir/autoload'
mkdir(dir, 'p')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2965,
/**/
2964,
/**/
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