mirror of
https://github.com/neovim/neovim.git
synced 2026-04-29 10:44:08 +00:00
vim-patch:9.0.0286: using freed memory when location list changed in autocmd
Problem: Using freed memory when location list changed in autocmd.
Solution: Return QF_ABORT and handle it. (Yegappan Lakshmanan,
closes vim/vim#10993)
6d24a51b94
This commit is contained in:
@@ -5886,5 +5886,22 @@ func Test_quickfixtextfunc_recursive()
|
||||
cclose
|
||||
endfunc
|
||||
|
||||
" Test for replacing the location list from an autocmd. This used to cause a
|
||||
" read from freed memory.
|
||||
func Test_loclist_replace_autocmd()
|
||||
%bw!
|
||||
call setloclist(0, [], 'f')
|
||||
let s:bufnr = bufnr()
|
||||
cal setloclist(0, [{'0': 0, '': ''}])
|
||||
au BufEnter * cal setloclist(1, [{'t': ''}, {'bufnr': s:bufnr}], 'r')
|
||||
lopen
|
||||
try
|
||||
exe "norm j\<CR>"
|
||||
catch
|
||||
endtry
|
||||
lnext
|
||||
%bw!
|
||||
call setloclist(0, [], 'f')
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user