mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.1.0098: segfault when pattern with \z() is very slow
Problem: Segfault when pattern with \z() is very slow. Solution: Check for NULL regprog. Add "nfa_fail" to test_override() to be able to test this. Fix that 'searchhl' resets called_emsg.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user