Fossil SCM

Prevent a segfault in the graph computation due to time skew. The graph is still not drawn right, but at least it displays something now.

drh 2010-02-09 11:37 trunk
Commit ff9efe3026083212cab3c901a3d46da9004d3319
1 file changed +6 -1
+6 -1
--- src/graph.c
+++ src/graph.c
@@ -229,11 +229,16 @@
229229
if( pRow->iRail>=0 ) continue;
230230
assert( pRow->nParent>0 );
231231
parentRid = pRow->aParent[0];
232232
assert( bag_find(&allRids, parentRid) );
233233
for(pDesc=pRow->pNext; pDesc && pDesc->rid!=parentRid; pDesc=pDesc->pNext){}
234
- assert( pDesc!=0 );
234
+ if( pDesc==0 ){
235
+ /* Time skew */
236
+ pRow->iRail = ++p->mxRail;
237
+ pRow->railInUse = 1<<pRow->iRail;
238
+ continue;
239
+ }
235240
if( pDesc->aiRaiser[pDesc->iRail]==0 && pDesc->zBranch==pRow->zBranch ){
236241
pRow->iRail = pDesc->iRail;
237242
}else{
238243
pRow->iRail = findFreeRail(p, 0, pDesc->idx, inUse);
239244
}
240245
--- src/graph.c
+++ src/graph.c
@@ -229,11 +229,16 @@
229 if( pRow->iRail>=0 ) continue;
230 assert( pRow->nParent>0 );
231 parentRid = pRow->aParent[0];
232 assert( bag_find(&allRids, parentRid) );
233 for(pDesc=pRow->pNext; pDesc && pDesc->rid!=parentRid; pDesc=pDesc->pNext){}
234 assert( pDesc!=0 );
 
 
 
 
 
235 if( pDesc->aiRaiser[pDesc->iRail]==0 && pDesc->zBranch==pRow->zBranch ){
236 pRow->iRail = pDesc->iRail;
237 }else{
238 pRow->iRail = findFreeRail(p, 0, pDesc->idx, inUse);
239 }
240
--- src/graph.c
+++ src/graph.c
@@ -229,11 +229,16 @@
229 if( pRow->iRail>=0 ) continue;
230 assert( pRow->nParent>0 );
231 parentRid = pRow->aParent[0];
232 assert( bag_find(&allRids, parentRid) );
233 for(pDesc=pRow->pNext; pDesc && pDesc->rid!=parentRid; pDesc=pDesc->pNext){}
234 if( pDesc==0 ){
235 /* Time skew */
236 pRow->iRail = ++p->mxRail;
237 pRow->railInUse = 1<<pRow->iRail;
238 continue;
239 }
240 if( pDesc->aiRaiser[pDesc->iRail]==0 && pDesc->zBranch==pRow->zBranch ){
241 pRow->iRail = pDesc->iRail;
242 }else{
243 pRow->iRail = findFreeRail(p, 0, pDesc->idx, inUse);
244 }
245

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button