diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-10-15 16:10:56 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-10-15 16:28:36 +0800 |
| commit | 6bc2d6b66b683faedded01128af8ad98b7130fef (patch) | |
| tree | d0986b71d8922178c32e010bf4b5615f0e0d1cc9 /src/nvim/testdir | |
| parent | 65cbe0cc35c07a929152b86e78717efa4ba155da (diff) | |
| download | rneovim-6bc2d6b66b683faedded01128af8ad98b7130fef.tar.gz rneovim-6bc2d6b66b683faedded01128af8ad98b7130fef.tar.bz2 rneovim-6bc2d6b66b683faedded01128af8ad98b7130fef.zip | |
vim-patch:9.0.0614: SpellFileMissing autocmd may delete buffer
Problem: SpellFileMissing autocmd may delete buffer.
Solution: Disallow deleting the current buffer to avoid using freed memory.
https://github.com/vim/vim/commit/ef976323e770315b5fca544efb6b2faa25674d15
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_autocmd.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 025bda4515..63ed3ff435 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -2752,6 +2752,16 @@ func Test_FileType_spell() setglobal spellfile= endfunc +" this was wiping out the current buffer and using freed memory +func Test_SpellFileMissing_bwipe() + next 0 + au SpellFileMissing 0 bwipe + call assert_fails('set spell spelllang=0', 'E937:') + + au! SpellFileMissing + bwipe +endfunc + " Test closing a window or editing another buffer from a FileChangedRO handler " in a readonly buffer func Test_FileChangedRO_winclose() |