Fossil SCM
Fix a potential infinite loop in the graph generator for overly-complex change graphs.
Commit
838283273ac6323706c331e08f7ac4b97988b139
Parent
355bd99669da655…
1 file changed
+3
-1
+3
-1
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -459,8 +459,10 @@ | ||
| 459 | 459 | */ |
| 460 | 460 | p->mxRail = 0; |
| 461 | 461 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 462 | 462 | if( pRow->iRail>p->mxRail ) p->mxRail = pRow->iRail; |
| 463 | 463 | if( pRow->mergeOut>p->mxRail ) p->mxRail = pRow->mergeOut; |
| 464 | - while( pRow->mergeDown>((1<<(p->mxRail+1))-1) ) p->mxRail++; | |
| 464 | + while( p->mxRail<GR_MAX_RAIL && pRow->mergeDown>((1<<(p->mxRail+1))-1) ){ | |
| 465 | + p->mxRail++; | |
| 466 | + } | |
| 465 | 467 | } |
| 466 | 468 | } |
| 467 | 469 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -459,8 +459,10 @@ | |
| 459 | */ |
| 460 | p->mxRail = 0; |
| 461 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 462 | if( pRow->iRail>p->mxRail ) p->mxRail = pRow->iRail; |
| 463 | if( pRow->mergeOut>p->mxRail ) p->mxRail = pRow->mergeOut; |
| 464 | while( pRow->mergeDown>((1<<(p->mxRail+1))-1) ) p->mxRail++; |
| 465 | } |
| 466 | } |
| 467 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -459,8 +459,10 @@ | |
| 459 | */ |
| 460 | p->mxRail = 0; |
| 461 | for(pRow=p->pFirst; pRow; pRow=pRow->pNext){ |
| 462 | if( pRow->iRail>p->mxRail ) p->mxRail = pRow->iRail; |
| 463 | if( pRow->mergeOut>p->mxRail ) p->mxRail = pRow->mergeOut; |
| 464 | while( p->mxRail<GR_MAX_RAIL && pRow->mergeDown>((1<<(p->mxRail+1))-1) ){ |
| 465 | p->mxRail++; |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 |