forked from aniani/vim
patch 8.1.0935: old regexp engine may use invalid buffer
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)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user