patch 8.2.2472: crash when using command line window in an autocommand
Problem: Crash when using command line window in an autocommand.
(houyunsong)
Solution: Save and restore au_new_curbuf.
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index cb5c62f..8ccc753 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -2739,9 +2739,9 @@
au BufNew,BufWinLeave * e %e
file yyy
au BufNew,BufWinLeave * ball
- call assert_fails('n xxx', 'E143:')
+ n xxx
- bwipe %
+ %bwipe
au! BufNew
au! BufWinLeave
endfunc
@@ -2759,4 +2759,19 @@
augroup END
endfunc
+" Fuzzer found some strange combination that caused a crash.
+func Test_autocmd_normal_mess()
+ augroup aucmd_normal_test
+ au BufLeave,BufWinLeave,BufHidden,BufUnload,BufDelete,BufWipeout * norm 7q/qc
+ augroup END
+ o4
+ silent! H
+ e xx
+ normal G
+
+ augroup aucmd_normal_test
+ au!
+ augroup END
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab