summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_autocmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-07 20:11:42 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-07 20:11:42 +0100
commitce6db0273f2c4359f48d75103a42991aa481f14e (patch)
tree1cb0e8a9563a92d4a92ff9ae0f00b0b6998e6c27 /src/testdir/test_autocmd.vim
parentfbcdf671f08cd2c7e60f35574231df0421112d99 (diff)
patch 8.2.0097: crash with autocommand and spellfilev8.2.0097
Problem: Crash with autocommand and spellfile. (Tim Pope) Solution: Do not pop exestack when not pushed. (closes #5450)
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r--src/testdir/test_autocmd.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index ab02402398..23deec6c30 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -2335,3 +2335,25 @@ func Test_BufWrite_lockmarks()
call delete('Xtest')
call delete('Xtest2')
endfunc
+
+func Test_FileType_spell()
+ if !isdirectory('/tmp')
+ throw "Skipped: requires /tmp directory"
+ endif
+
+ " this was crashing with an invalid free()
+ setglobal spellfile=/tmp/en.utf-8.add
+ augroup crash
+ autocmd!
+ autocmd BufNewFile,BufReadPost crashfile setf somefiletype
+ autocmd BufNewFile,BufReadPost crashfile set ft=anotherfiletype
+ autocmd FileType anotherfiletype setlocal spell
+ augroup END
+ func! NoCrash() abort
+ edit /tmp/crashfile
+ endfunc
+ call NoCrash()
+
+ au! crash
+ setglobal spellfile=
+endfunc