Skip to content

Commit 0bff38f

Browse files
committed
updated for version 7.4.623
Problem: Crash with pattern: \(\)\{80000} (Dominique Pelle) Solution: When the max limit is large fall back to the old engine.
1 parent 172b6d9 commit 0bff38f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/regexp_nfa.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,9 +2034,10 @@ nfa_regpiece()
20342034
}
20352035

20362036
/* The engine is very inefficient (uses too many states) when the
2037-
* maximum is much larger than the minimum. Bail out if we can
2038-
* use the other engine. */
2039-
if ((nfa_re_flags & RE_AUTO) && maxval > minval + 200)
2037+
* maximum is much larger than the minimum and when the maximum is
2038+
* large. Bail out if we can use the other engine. */
2039+
if ((nfa_re_flags & RE_AUTO)
2040+
&& (maxval > minval + 200 || maxval > 500))
20402041
return FAIL;
20412042

20422043
/* Ignore previous call to nfa_regatom() */
@@ -4254,7 +4255,6 @@ state_in_list(l, state, subs)
42544255
* Add "state" and possibly what follows to state list ".".
42554256
* Returns "subs_arg", possibly copied into temp_subs.
42564257
*/
4257-
42584258
static regsubs_T *
42594259
addstate(l, state, subs_arg, pim, off)
42604260
nfa_list_T *l; /* runtime state list */
@@ -4392,6 +4392,7 @@ addstate(l, state, subs_arg, pim, off)
43924392
subs = &temp_subs;
43934393
}
43944394

4395+
/* TODO: check for vim_realloc() returning NULL. */
43954396
l->t = vim_realloc(l->t, newlen * sizeof(nfa_thread_T));
43964397
l->len = newlen;
43974398
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
623,
744746
/**/
745747
622,
746748
/**/

0 commit comments

Comments
 (0)