From 5f84b1dc4154ea8def87b6113fa9b9ed058d83d2 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 7 Mar 2019 06:05:22 -0500 Subject: vim-patch:8.1.0935: old regexp engine may use invalid buffer #9692 Problem: Old regexp engine may use invalid buffer for 'iskeyword' or uninitialized buffer pointer. (Kuang-che Wu) Solution: Set rex.reg_buf when compiling the pattern. (closes vim/vim#3972) https://github.com/vim/vim/commit/8bfd9469cef536f171e6666f9d9217192e09d161 --- src/nvim/testdir/test_regexp_latin.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_regexp_latin.vim b/src/nvim/testdir/test_regexp_latin.vim index eb8f69ef15..8f9b1eb7ca 100644 --- a/src/nvim/testdir/test_regexp_latin.vim +++ b/src/nvim/testdir/test_regexp_latin.vim @@ -47,3 +47,19 @@ func Test_get_equi_class() s/.*/[[. call assert_equal(1, search(getline(1))) endfunc + +func Test_rex_init() + set noincsearch + set re=1 + new + setlocal iskeyword=a-z + call setline(1, ['abc', 'ABC']) + call assert_equal(1, search('[[:keyword:]]')) + new + setlocal iskeyword=A-Z + call setline(1, ['abc', 'ABC']) + call assert_equal(2, search('[[:keyword:]]')) + bwipe! + bwipe! + set re=0 +endfunc -- cgit