mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
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:
@@ -1841,7 +1841,13 @@ check_func_args_from_type(
|
||||
type_T *expected;
|
||||
|
||||
if (varargs && i >= type->tt_argcount - 1)
|
||||
expected = type->tt_args[type->tt_argcount - 1]->tt_member;
|
||||
{
|
||||
expected = type->tt_args[type->tt_argcount - 1];
|
||||
if (expected != NULL && expected->tt_type == VAR_LIST)
|
||||
expected = expected->tt_member;
|
||||
if (expected == NULL)
|
||||
expected = &t_any;
|
||||
}
|
||||
else if (i >= type->tt_min_argcount
|
||||
&& actual->tt_type == VAR_SPECIAL)
|
||||
expected = &t_any;
|
||||
|
Reference in New Issue
Block a user