From: Bram Moolenaar Date: Sat, 2 May 2020 17:04:58 +0000 (+0200) Subject: patch 8.2.0682: Vim9: parsing function argument type can get stuck X-Git-Tag: v8.2.0682 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c0d44f8efae36c079cb8be395785827aa0b2737;p=vim 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. --- diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 0fd28924a..e1b3b7ffd 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -113,6 +113,7 @@ def Test_call_wrong_args() call CheckDefFailure(['TakesOneArg()'], 'E119:') call CheckDefFailure(['TakesOneArg(11, 22)'], 'E118:') call CheckDefFailure(['bufnr(xxx)'], 'E1001:') + call CheckScriptFailure(['def Func(Ref: func(s: string))'], 'E475:') enddef " Default arg and varargs diff --git a/src/version.c b/src/version.c index 982ac1f88..21cda476a 100644 --- a/src/version.c +++ b/src/version.c @@ -746,6 +746,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 682, /**/ 681, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index 5644c5035..eb84e3590 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -1663,7 +1663,11 @@ skip_type(char_u *start) ++p; while (*p != ')' && *p != NUL) { + char_u *sp = p; + p = skip_type(p); + if (p == sp) + return p; // syntax error if (*p == ',') p = skipwhite(p + 1); }