diff src/testdir/test_syntax.vim @ 14161:7cac4646c552 v8.1.0098

patch 8.1.0098: segfault when pattern with z() is very slow commit https://github.com/vim/vim/commit/bcf9442307075bac40d44328c8bf7ea21857b138 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 23 14:21:42 2018 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Sat, 23 Jun 2018 14:30:07 +0200
parents 424321d6eea7
children 1946487c74ba
line wrap: on
line diff
--- a/src/testdir/test_syntax.vim
+++ b/src/testdir/test_syntax.vim
@@ -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