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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221114205247.8E5A31C0473%40moolenaar.net.

Raspunde prin e-mail lui