summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-02 19:04:58 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-02 19:04:58 +0200
commit1c0d44f8efae36c079cb8be395785827aa0b2737 (patch)
treeaba827e5aa9d8b8c3f92d31c57fc19abd01c4a13 /src/vim9compile.c
parent0b6849e9e302286e906d97e4ba017dd66561a9ce (diff)
downloadvim-git-8.2.0682.tar.gz
patch 8.2.0682: Vim9: parsing function argument type can get stuckv8.2.0682
Problem: Vim9: parsing function argument type can get stuck. Solution: Bail out when not making progress.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c4
1 files changed, 4 insertions, 0 deletions
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);
}