mirror of
https://github.com/neovim/neovim.git
synced 2025-11-17 07:41:27 +00:00
vim-patch:7.4.1647
Problem: Using freed memory after setqflist() and ":caddbuffer". (Dominique)
Solution: Set qf_ptr when adding the first item to the quickfix list.
8b20179c65
This commit is contained in:
@@ -443,6 +443,17 @@ describe('helpgrep', function()
|
||||
|
||||
augroup! testgroup
|
||||
endfunc
|
||||
|
||||
func Test_caddbuffer_to_empty()
|
||||
helpgr quickfix
|
||||
call setqflist([], 'r')
|
||||
cad
|
||||
call assert_fails('cn', 'E553:')
|
||||
" Upstream calls quit! here to verify vim is still
|
||||
" running, but that will be covered by the
|
||||
" expected_empty() call in the busted test
|
||||
" quit!
|
||||
endfunc
|
||||
]])
|
||||
end)
|
||||
|
||||
@@ -522,6 +533,11 @@ describe('helpgrep', function()
|
||||
call('XquickfixChangedByAutocmd', 'l')
|
||||
expected_empty()
|
||||
end)
|
||||
|
||||
it('does not crash after using caddbuffer with an empty qf list', function()
|
||||
call('Test_caddbuffer_to_empty')
|
||||
expected_empty()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('errorformat', function()
|
||||
|
||||
Reference in New Issue
Block a user