}
/* 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)
+ * 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;
/* Ignore previous call to nfa_regatom() */
* Add "state" and possibly what follows to state list ".".
* Returns "subs_arg", possibly copied into temp_subs.
*/
-
static regsubs_T *
addstate(l, state, subs_arg, pim, off)
nfa_list_T *l; /* runtime state list */
subs = &temp_subs;
}
+ /* TODO: check for vim_realloc() returning NULL. */
l->t = vim_realloc(l->t, newlen * sizeof(nfa_thread_T));
l->len = newlen;
}