patch 8.0.1218: writing to freed memory in autocmd
Problem: Writing to freed memory in autocmd.
Solution: Make a copy of the tag line. (Dominique Pelle, closes #2245)
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 6ca3b22..aa7d157 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -249,6 +249,24 @@
au! VimEnter
endfunc
+func Test_BufReadCmdHelp()
+ " This used to cause access to free memory
+ au BufReadCmd * e +h
+ help
+
+ helpclose
+ au! BufReadCmd
+endfunc
+
+func Test_BufReadCmdHelpJump()
+ " This used to cause access to free memory
+ au BufReadCmd * e +h{
+ help
+
+ helpclose
+ au! BufReadCmd
+endfunc
+
func Test_augroup_deleted()
" This caused a crash before E936 was introduced
augroup x