Mercurial > vim
diff src/vim9execute.c @ 25543:a84e75d73fde v8.2.3308
patch 8.2.3308: Vim9: no runtime check for argument type with varargs only
Commit: https://github.com/vim/vim/commit/6ce46b99635877fb0a17c06a6f5625fbc1ffa6f4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 7 15:35:36 2021 +0200
patch 8.2.3308: Vim9: no runtime check for argument type with varargs only
Problem: Vim9: no runtime check for argument type if a function only has
varargs.
Solution: Also check argument types if uf_va_type is set. (closes #8715)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 07 Aug 2021 15:45:02 +0200 |
parents | 2ae1d5a4ae5c |
children | 08a0abcb46c1 |
line wrap: on
line diff
--- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -893,7 +893,7 @@ call_by_name( if (ufunc != NULL) { - if (ufunc->uf_arg_types != NULL) + if (ufunc->uf_arg_types != NULL || ufunc->uf_va_type != NULL) { int i; typval_T *argv = STACK_TV_BOT(0) - argcount; @@ -904,7 +904,7 @@ call_by_name( { type_T *type = NULL; - if (i < ufunc->uf_args.ga_len) + if (i < ufunc->uf_args.ga_len && ufunc->uf_arg_types != NULL) type = ufunc->uf_arg_types[i]; else if (ufunc->uf_va_type != NULL) type = ufunc->uf_va_type->tt_member;