comparison src/vim9execute.c @ 24808:0bc60e26a2b5 v8.2.2942

patch 8.2.2942: Vim9: error when calling function with too few arguments Commit: https://github.com/vim/vim/commit/8da6d6db340069b3307e6bce3cdd40441197efce Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 5 18:15:09 2021 +0200 patch 8.2.2942: Vim9: error when calling function with too few arguments Problem: Vim9: internal error when calling function with too few arguments Solution: Check for argument count to be too few. (closes https://github.com/vim/vim/issues/8325)
author Bram Moolenaar <Bram@vim.org>
date Sat, 05 Jun 2021 18:30:03 +0200
parents 28127371aa18
children 30095f94d081
comparison
equal deleted inserted replaced
24807:e651d1ef23b5 24808:0bc60e26a2b5
4232 emsg(_(e_one_argument_too_many)); 4232 emsg(_(e_one_argument_too_many));
4233 else 4233 else
4234 semsg(_(e_nr_arguments_too_many), idx); 4234 semsg(_(e_nr_arguments_too_many), idx);
4235 goto failed_early; 4235 goto failed_early;
4236 } 4236 }
4237 else if (idx < 0)
4238 {
4239 if (idx == -1)
4240 emsg(_(e_one_argument_too_few));
4241 else
4242 semsg(_(e_nr_arguments_too_few), -idx);
4243 goto failed_early;
4244 }
4237 4245
4238 // Put arguments on the stack, but no more than what the function expects. 4246 // Put arguments on the stack, but no more than what the function expects.
4239 // A lambda can be called with more arguments than it uses. 4247 // A lambda can be called with more arguments than it uses.
4240 for (idx = 0; idx < argc 4248 for (idx = 0; idx < argc
4241 && (ufunc->uf_va_name != NULL || idx < ufunc->uf_args.ga_len); 4249 && (ufunc->uf_va_name != NULL || idx < ufunc->uf_args.ga_len);