0
0
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:
Bram Moolenaar
2020-07-19 14:03:09 +02:00
parent 6434fc574d
commit 65b9545f44
5 changed files with 61 additions and 0 deletions

View File

@@ -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;
}