0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.2283: Vim9: crash when lambda has fewer arguments than expected

Problem:    Vim9: crash when lambda has fewer arguments than expected.
Solution:   Don't check arguments when already failed. (closes #7606)
This commit is contained in:
Bram Moolenaar
2021-01-03 13:09:51 +01:00
parent 339c1bdbdf
commit e68b02a1c4
3 changed files with 17 additions and 2 deletions

View File

@@ -490,8 +490,9 @@ check_type(type_T *expected, type_T *actual, int give_msg, int argidx)
&& actual->tt_argcount != -1
&& (actual->tt_argcount < expected->tt_min_argcount
|| actual->tt_argcount > expected->tt_argcount))
ret = FAIL;
if (expected->tt_args != NULL && actual->tt_args != NULL)
ret = FAIL;
if (ret == OK && expected->tt_args != NULL
&& actual->tt_args != NULL)
{
int i;