From c67139f8aac54af9ea2095dd5028010910a588b3 Mon Sep 17 00:00:00 2001 From: nthanben <39383885+nthanben@users.noreply.github.com> Date: Thu, 24 May 2018 14:30:21 -0700 Subject: vim-patch:8.0.0503: endless loop in updating folds with 32 bit ints (#8433) Problem: Endless loop in updating folds with 32 bit ints. Solution: Subtract from LHS instead of add to the RHS. (Matthew Malcomson) vim/vim@9d20ce6 --- src/nvim/fold.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/fold.c b/src/nvim/fold.c index ad9cd4d562..7a95f4ab0c 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -2445,7 +2445,7 @@ static linenr_T foldUpdateIEMSRecurse(garray_T *gap, int level, if (lvl < level) { /* End of fold found, update the length when it got shorter. */ if (fp->fd_len != flp->lnum - fp->fd_top) { - if (fp->fd_top + fp->fd_len > bot + 1) { + if (fp->fd_top + fp->fd_len - 1 > bot) { /* fold continued below bot */ if (getlevel == foldlevelMarker || getlevel == foldlevelExpr -- cgit