aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_syntax.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-11-29 01:51:26 +0100
committerGitHub <noreply@github.com>2018-11-29 01:51:26 +0100
commit5a752c97d5294f4a69613db71adf9beb6a8f8790 (patch)
tree7483b993657af7aa07dd2cb3a3390bc0dbf40899 /src/nvim/testdir/test_syntax.vim
parent98eaf60a98d0dfec9b1addb2c4efb3655c095044 (diff)
downloadrneovim-5a752c97d5294f4a69613db71adf9beb6a8f8790.tar.gz
rneovim-5a752c97d5294f4a69613db71adf9beb6a8f8790.tar.bz2
rneovim-5a752c97d5294f4a69613db71adf9beb6a8f8790.zip
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. https://github.com/vim/vim/commit/bcf9442307075bac40d44328c8bf7ea21857b138 closes #8788
Diffstat (limited to 'src/nvim/testdir/test_syntax.vim')
-rw-r--r--src/nvim/testdir/test_syntax.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim
index e35c0f1105..e70d9b7c66 100644
--- a/src/nvim/testdir/test_syntax.vim
+++ b/src/nvim/testdir/test_syntax.vim
@@ -482,3 +482,15 @@ fun Test_synstack_synIDtrans()
syn clear
bw!
endfunc
+
+" 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