0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14: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:
Bram Moolenaar
2018-06-23 14:21:42 +02:00
parent 5efa0102de
commit bcf9442307
10 changed files with 45 additions and 8 deletions

View File

@@ -562,3 +562,15 @@ func Test_syntax_c()
let $COLORFGBG = ''
call delete('Xtest.c')
endfun
" Using \z() in a region with NFA failing should not crash.
func Test_syn_wrong_z_one()
new
call setline(1, ['just some text', 'with foo and bar to match with'])
syn region FooBar start="foo\z(.*\)bar" end="\z1"
call test_override("nfa_fail", 1)
redraw!
redraw!
call test_override("ALL", 0)
bwipe!
endfunc