diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-10-13 11:10:30 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-10-13 11:47:59 +0800 |
| commit | f72ae4514c51bb2a7c0fdfc8e2a469037dd36666 (patch) | |
| tree | 71e353d9378d9f70ef2616e1f1c8d090a6bda90a /src/nvim/testdir | |
| parent | 5740b3e076770336a15e88263878546345a3d325 (diff) | |
| download | rneovim-f72ae4514c51bb2a7c0fdfc8e2a469037dd36666.tar.gz rneovim-f72ae4514c51bb2a7c0fdfc8e2a469037dd36666.tar.bz2 rneovim-f72ae4514c51bb2a7c0fdfc8e2a469037dd36666.zip | |
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)
https://github.com/vim/vim/commit/6d24a51b94beb1991cddce221f90b455e2d50db7
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 449904fcb4..4802d1f188 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -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 |