0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.0.0503: endless loop in updating folds with 32 bit ints

Problem:    Endless loop in updating folds with 32 bit ints.
Solution:   Subtract from LHS instead of add to the RHS. (Matthew Malcomson)
This commit is contained in:
Bram Moolenaar
2017-03-23 21:53:35 +01:00
parent a37ffaa5e0
commit 9d20ce6970
2 changed files with 3 additions and 1 deletions

View File

@@ -2755,7 +2755,7 @@ foldUpdateIEMSRecurse(
/* 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

View File

@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
503,
/**/
502,
/**/