1
0
forked from aniani/vim

patch 9.0.1138: crash when expecting varargs but it is something else

Problem:    Crash when expecting varargs but it is something else.
Solution:   Only use the member when the type is a list. (closes #11774)
This commit is contained in:
Bram Moolenaar
2023-01-03 12:33:26 +00:00
parent ea720aea85
commit 36818a9daa
4 changed files with 26 additions and 2 deletions

View File

@@ -932,8 +932,10 @@ check_argument_types(
if (varargs && i >= type->tt_argcount - 1)
{
expected = type->tt_args[type->tt_argcount - 1];
if (expected != NULL)
if (expected != NULL && expected->tt_type == VAR_LIST)
expected = expected->tt_member;
if (expected == NULL)
expected = &t_any;
}
else
expected = type->tt_args[i];