]> granicus.if.org Git - vim/commitdiff
patch 8.0.0583: fold test hangs on MS-Windows v8.0.0583
authorBram Moolenaar <Bram@vim.org>
Sun, 23 Apr 2017 14:48:20 +0000 (16:48 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 23 Apr 2017 14:48:20 +0000 (16:48 +0200)
Problem:    Fold test hangs on MS-Windows.
Solution:   Avoid overflow in compare.

src/fold.c
src/version.c

index 8f068dccf117c1bc25d409efec19f338931083aa..f8abe22d72f49a330b893672e9c0697608af13c9 100644 (file)
@@ -2928,7 +2928,7 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
        {
            /* 2: or 3: need to delete nested folds */
            foldRemove(&fp->fd_nested, top - fp->fd_top, bot - fp->fd_top);
-           if (fp->fd_top + fp->fd_len > bot + 1)
+           if (fp->fd_top + fp->fd_len - 1 > bot)
            {
                /* 3: need to split it. */
                foldSplit(gap, (int)(fp - (fold_T *)gap->ga_data), top, bot);
@@ -2970,10 +2970,12 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
 
 /* foldReverseOrder() {{{2 */
     static void
-foldReverseOrder(garray_T *gap, linenr_T start, linenr_T end)
+foldReverseOrder(garray_T *gap, linenr_T start_arg, linenr_T end_arg)
 {
     fold_T *left, *right;
     fold_T tmp;
+    linenr_T start = start_arg;
+    linenr_T end = end_arg;
 
     for (; start < end; start++, end--)
     {
index 0533f574d23603ff320a6f5c4bf5e69c192177d5..fd84c76740307a38490da28c2edbd0851d202290 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    583,
 /**/
     582,
 /**/