summaryrefslogtreecommitdiff
path: root/src/testdir/test_regexp_latin.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-16 18:07:57 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-16 18:07:57 +0100
commit8bfd9469cef536f171e6666f9d9217192e09d161 (patch)
tree1f5b859c8c2b118440a067103edf130120300ca3 /src/testdir/test_regexp_latin.vim
parent985079c514e9ab85598b7bca019c77d3e42526f5 (diff)
downloadvim-git-8bfd9469cef536f171e6666f9d9217192e09d161.tar.gz
patch 8.1.0935: old regexp engine may use invalid bufferv8.1.0935
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 #3972)
Diffstat (limited to 'src/testdir/test_regexp_latin.vim')
-rw-r--r--src/testdir/test_regexp_latin.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testdir/test_regexp_latin.vim b/src/testdir/test_regexp_latin.vim
index 09104a142..d63b4f958 100644
--- a/src/testdir/test_regexp_latin.vim
+++ b/src/testdir/test_regexp_latin.vim
@@ -104,3 +104,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