forked from aniani/vim
patch 8.2.3741: using freed memory in open command
Problem: Using freed memory in open command. Solution: Make a copy of the current line.
This commit is contained in:
@@ -121,6 +121,19 @@ func Test_open_command()
|
||||
close!
|
||||
endfunc
|
||||
|
||||
func Test_open_command_flush_line()
|
||||
" this was accessing freed memory: the regexp match uses a pointer to the
|
||||
" current line which becomes invalid when searching for the ') mark.
|
||||
new
|
||||
call setline(1, ['one', 'two. three'])
|
||||
s/one/ONE
|
||||
try
|
||||
open /\%')/
|
||||
catch /E479/
|
||||
endtry
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Test for :g/pat/visual to run vi commands in Ex mode
|
||||
" This used to hang Vim before 8.2.0274.
|
||||
func Test_Ex_global()
|
||||
|
Reference in New Issue
Block a user