Patch 9.0.0882
Problem: Using freed memory after SpellFileMissing autocmd uses bwipe.
Solution: Bail out if the window no longer exists.
Files: src/spell.c, src/testdir/test_spell.vim
*** ../vim-9.0.0881/src/spell.c 2022-11-02 13:30:37.538314551 +0000
--- src/spell.c 2022-11-14 20:49:19.945194627 +0000
***************
*** 2110,2117 ****
{
spell_load_lang(lang);
// SpellFileMissing autocommands may do anything, including
! // destroying the buffer we are using...
! if (!bufref_valid(&bufref))
{
ret_msg = N_(e_spellfilemising_autocommand_deleted_buffer);
goto theend;
--- 2110,2117 ----
{
spell_load_lang(lang);
// SpellFileMissing autocommands may do anything, including
! // destroying the buffer we are using or closing the window.
! if (!bufref_valid(&bufref) || !win_valid_any_tab(wp))
{
ret_msg = N_(e_spellfilemising_autocommand_deleted_buffer);
goto theend;
*** ../vim-9.0.0881/src/testdir/test_spell.vim 2022-10-10 22:39:38.203545897 +0100
--- src/testdir/test_spell.vim 2022-11-14 20:39:23.600747820 +0000
***************
*** 159,164 ****
--- 159,177 ----
%bwipe!
endfunc
+ func Test_spell_file_missing_bwipe()
+ " this was using a window that was wiped out in a SpellFileMissing autocmd
+ set spelllang=xy
+ au SpellFileMissing * n0
+ set spell
+ au SpellFileMissing * bw
+ snext somefile
+
+ au! SpellFileMissing
+ bwipe!
+ set nospell spelllang=en
+ endfunc
+
func Test_spelldump()
" In case the spell file is not found avoid getting the download dialog, we
" would get stuck at the prompt.
*** ../vim-9.0.0881/src/version.c 2022-11-14 19:49:09.662298086 +0000
--- src/version.c 2022-11-14 20:41:30.640845381 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 882,
/**/
--
hundred-and-one symptoms of being an internet addict:
68. Your cat always puts viruses on your dogs homepage
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///