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.

a1d2c58985
This commit is contained in:
Shougo Matsushita 2015-11-29 16:32:00 +09:00
parent a03af86cc2
commit 798fe6cfa3
2 changed files with 5 additions and 4 deletions

View File

@ -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;
}

View File

@ -373,7 +373,7 @@ static int included_patches[] = {
// 626 NA
// 625 NA
// 624,
// 623,
623,
// 622 NA
// 621 NA
// 620,