mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.0682: Vim9: parsing function argument type can get stuck
Problem: Vim9: parsing function argument type can get stuck. Solution: Bail out when not making progress.
This commit is contained in:
@@ -113,6 +113,7 @@ def Test_call_wrong_args()
|
|||||||
call CheckDefFailure(['TakesOneArg()'], 'E119:')
|
call CheckDefFailure(['TakesOneArg()'], 'E119:')
|
||||||
call CheckDefFailure(['TakesOneArg(11, 22)'], 'E118:')
|
call CheckDefFailure(['TakesOneArg(11, 22)'], 'E118:')
|
||||||
call CheckDefFailure(['bufnr(xxx)'], 'E1001:')
|
call CheckDefFailure(['bufnr(xxx)'], 'E1001:')
|
||||||
|
call CheckScriptFailure(['def Func(Ref: func(s: string))'], 'E475:')
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
" Default arg and varargs
|
" Default arg and varargs
|
||||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
682,
|
||||||
/**/
|
/**/
|
||||||
681,
|
681,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -1663,7 +1663,11 @@ skip_type(char_u *start)
|
|||||||
++p;
|
++p;
|
||||||
while (*p != ')' && *p != NUL)
|
while (*p != ')' && *p != NUL)
|
||||||
{
|
{
|
||||||
|
char_u *sp = p;
|
||||||
|
|
||||||
p = skip_type(p);
|
p = skip_type(p);
|
||||||
|
if (p == sp)
|
||||||
|
return p; // syntax error
|
||||||
if (*p == ',')
|
if (*p == ',')
|
||||||
p = skipwhite(p + 1);
|
p = skipwhite(p + 1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user