mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
Merge pull request #17680 from zeertzjq/vim-8.2.4440
vim-patch:8.2.{4440,4443}: crash with specific regexp pattern and string
This commit is contained in:
commit
08d9d74fd9
@ -4083,6 +4083,10 @@ static bool regmatch(
|
|||||||
break;
|
break;
|
||||||
if (rex.input == rex.line) {
|
if (rex.input == rex.line) {
|
||||||
// backup to last char of previous line
|
// backup to last char of previous line
|
||||||
|
if (rex.lnum == 0) {
|
||||||
|
status = RA_NOMATCH;
|
||||||
|
break;
|
||||||
|
}
|
||||||
rex.lnum--;
|
rex.lnum--;
|
||||||
rex.line = reg_getline(rex.lnum);
|
rex.line = reg_getline(rex.lnum);
|
||||||
// Just in case regrepeat() didn't count right.
|
// Just in case regrepeat() didn't count right.
|
||||||
|
@ -540,7 +540,6 @@ endfunc
|
|||||||
" Check that [[:upper:]] matches for automatic engine
|
" Check that [[:upper:]] matches for automatic engine
|
||||||
func Test_match_char_class_upper()
|
func Test_match_char_class_upper()
|
||||||
new
|
new
|
||||||
let _engine=®expengine
|
|
||||||
|
|
||||||
" Test 1: [[:upper:]]\{2,\}
|
" Test 1: [[:upper:]]\{2,\}
|
||||||
set regexpengine=0
|
set regexpengine=0
|
||||||
@ -581,7 +580,7 @@ func Test_match_char_class_upper()
|
|||||||
call assert_equal(4, searchcount().total, 'TEST 3 lower')
|
call assert_equal(4, searchcount().total, 'TEST 3 lower')
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
let ®expengine=_engine
|
set regexpengine=0
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@ -593,4 +592,13 @@ func Test_match_invalid_byte()
|
|||||||
call delete('Xinvalid')
|
call delete('Xinvalid')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_match_too_complicated()
|
||||||
|
set regexpengine=1
|
||||||
|
exe "noswapfile vsplit \xeb\xdb\x99"
|
||||||
|
silent! buf \&\zs*\zs*0
|
||||||
|
bwipe!
|
||||||
|
set regexpengine=0
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user