mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 07:16:09 +00:00
vim-patch:8.1.0098: segfault when pattern with \z() is very slow (#9283)
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.
bcf9442307
closes #8788
This commit is contained in:
@@ -5603,6 +5603,7 @@ next_search_hl (
|
||||
linenr_T l;
|
||||
colnr_T matchcol;
|
||||
long nmatched = 0;
|
||||
int save_called_emsg = called_emsg;
|
||||
|
||||
if (shl->lnum != 0) {
|
||||
/* Check for three situations:
|
||||
@@ -5695,6 +5696,9 @@ next_search_hl (
|
||||
shl->lnum += shl->rm.startpos[0].lnum;
|
||||
break; /* useful match found */
|
||||
}
|
||||
|
||||
// Restore called_emsg for assert_fails().
|
||||
called_emsg = save_called_emsg;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user