aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2015-11-29 16:32:00 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2015-12-01 07:50:30 +0900
commit798fe6cfa35b96ac14c0682e93567fa32123048c (patch)
tree36c03ed912e7111160c34c51b8c123a8c832f258
parenta03af86cc28d9e755f5941b5dfaf54d003a1ad97 (diff)
downloadrneovim-798fe6cfa35b96ac14c0682e93567fa32123048c.tar.gz
rneovim-798fe6cfa35b96ac14c0682e93567fa32123048c.tar.bz2
rneovim-798fe6cfa35b96ac14c0682e93567fa32123048c.zip
vim-patch:7.4.623
Problem: Crash with pattern: \(\)\{80000} (Dominique Pelle) Solution: When the max limit is large fall back to the old engine. https://github.com/vim/vim/commit/a1d2c58985584116d20fa5e132137d8ff1a535f7
-rw-r--r--src/nvim/regexp_nfa.c7
-rw-r--r--src/nvim/version.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index fa356da5b9..b96dcc66b3 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -1897,9 +1897,10 @@ static int nfa_regpiece(void)
return OK;
}
- // The engine is very inefficient (uses too many states) when the maximum is
- // much larger than the minimum. Bail out if we can use the other engine.
- if ((nfa_re_flags & RE_AUTO) && maxval > minval + 200) {
+ // The engine is very inefficient (uses too many states) when the maximum
+ // is much larger than the minimum and when the maximum is large. Bail out
+ // if we can use the other engine.
+ if ((nfa_re_flags & RE_AUTO) && (maxval > minval + 200 || maxval > 500)) {
return FAIL;
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index d5bbd734f4..c9618ae246 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -373,7 +373,7 @@ static int included_patches[] = {
// 626 NA
// 625 NA
// 624,
- // 623,
+ 623,
// 622 NA
// 621 NA
// 620,