Patch 8.2.1972
Problem:    Crash when recreating nested fold.
Solution:   Check for empty growarray. (closes #7278)
Files:      src/fold.c, src/testdir/test_fold.vim


*** ../vim-8.2.1971/src/fold.c  2020-11-03 20:05:36.178750002 +0100
--- src/fold.c  2020-11-10 18:22:35.122732565 +0100
***************
*** 640,646 ****
                break;
            }
        }
!       i = (int)(fp - (fold_T *)gap->ga_data);
      }
  
      if (ga_grow(gap, 1) == OK)
--- 640,649 ----
                break;
            }
        }
!       if (gap->ga_len == 0)
!           i = 0;
!       else
!           i = (int)(fp - (fold_T *)gap->ga_data);
      }
  
      if (ga_grow(gap, 1) == OK)
*** ../vim-8.2.1971/src/testdir/test_fold.vim   2020-11-03 20:05:36.178750002 
+0100
--- src/testdir/test_fold.vim   2020-11-10 18:18:54.751422514 +0100
***************
*** 844,847 ****
--- 844,857 ----
    bwipe!
  endfunc
  
+ " this was crashing
+ func Test_fold_create_delete_create()
+   new
+   fold
+   fold
+   normal zd
+   fold
+   bwipe!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.1971/src/version.c       2020-11-10 11:43:52.853854197 +0100
--- src/version.c       2020-11-10 18:19:59.943217450 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     1972,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
227. You sleep next to your monitor.  Or on top of it.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202011101724.0AAHOI0v607033%40masaka.moolenaar.net.

Raspunde prin e-mail lui