mirror of
https://github.com/vim/vim.git
synced 2025-10-08 06:04:08 -04:00
updated for version 7.4.593
Problem: Crash when searching for "x\{0,90000}". (Dominique Pelle) Solution: Bail out from the NFA engine when the max limit is much higher than the min limit.
This commit is contained in:
13
src/regexp.c
13
src/regexp.c
@@ -8081,7 +8081,8 @@ vim_regcomp(expr_arg, re_flags)
|
||||
* First try the NFA engine, unless backtracking was requested.
|
||||
*/
|
||||
if (regexp_engine != BACKTRACKING_ENGINE)
|
||||
prog = nfa_regengine.regcomp(expr, re_flags);
|
||||
prog = nfa_regengine.regcomp(expr,
|
||||
re_flags + (regexp_engine == AUTOMATIC_ENGINE ? RE_AUTO : 0));
|
||||
else
|
||||
prog = bt_regengine.regcomp(expr, re_flags);
|
||||
|
||||
@@ -8105,16 +8106,14 @@ vim_regcomp(expr_arg, re_flags)
|
||||
#endif
|
||||
/*
|
||||
* If the NFA engine failed, try the backtracking engine.
|
||||
* Disabled for now, both engines fail on the same patterns.
|
||||
* Re-enable when regcomp() fails when the pattern would work better
|
||||
* with the other engine.
|
||||
*
|
||||
* The NFA engine also fails for patterns that it can't handle well
|
||||
* but are still valid patterns, thus a retry should work.
|
||||
*/
|
||||
if (regexp_engine == AUTOMATIC_ENGINE)
|
||||
{
|
||||
regexp_engine = BACKTRACKING_ENGINE;
|
||||
prog = bt_regengine.regcomp(expr, re_flags);
|
||||
regexp_engine == BACKTRACKING_ENGINE;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if (prog != NULL)
|
||||
|
Reference in New Issue
Block a user