summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 5feaac6f5..7db69183e 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -3327,6 +3327,12 @@ syn_regexec(
profile_start(&pt);
#endif
+ if (rmp->regprog == NULL)
+ // This can happen if a previous call to vim_regexec_multi() tried to
+ // use the NFA engine, which resulted in NFA_TOO_EXPENSIVE, and
+ // compiling the pattern with the other engine fails.
+ return FALSE;
+
rmp->rmm_maxcol = syn_buf->b_p_smc;
r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col,
#ifdef FEAT_RELTIME