mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.1242: Vim9: no error if calling a function with wrong type
Problem: Vim9: no error if calling a function with wrong argument type. Solution: Check types of arguments. (closes #6469)
This commit is contained in:
@@ -737,6 +737,9 @@ call_def_function(
|
||||
// Put arguments on the stack.
|
||||
for (idx = 0; idx < argc; ++idx)
|
||||
{
|
||||
if (ufunc->uf_arg_types != NULL && idx < ufunc->uf_args.ga_len
|
||||
&& check_argtype(ufunc->uf_arg_types[idx], &argv[idx]) == FAIL)
|
||||
goto failed_early;
|
||||
copy_tv(&argv[idx], STACK_TV_BOT(0));
|
||||
++ectx.ec_stack.ga_len;
|
||||
}
|
||||
|
Reference in New Issue
Block a user