Skip to content

Commit 48d09e7

Browse files
committed
Fixing a corner case crash.
1 parent bde60f2 commit 48d09e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/aig/gia/giaSweep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ Gia_Man_t * Gia_ManSweepWithBoxes( Gia_Man_t * p, void * pParsC, void * pParsS,
751751
if ( pNew == NULL )
752752
return NULL;
753753
Gia_ManTransferTiming( pNew, p );
754-
nFlops = Vec_IntCountEntry(pNew->vRegClasses, 1);
754+
nFlops = pNew->vRegClasses ? Vec_IntCountEntry(pNew->vRegClasses, 1) : 0;
755755
// find global equivalences
756756
pClp = Gia_ManDupCollapse( pNew, pNew->pAigExtra, NULL, pParsC ? 0 : 1 );
757757
//Gia_DumpAiger( pClp, p->pSpec, 1, 1 );
@@ -775,7 +775,7 @@ Gia_Man_t * Gia_ManSweepWithBoxes( Gia_Man_t * p, void * pParsC, void * pParsS,
775775
pNew = Gia_ManDupWithBoxes( pTemp = pNew, pParsC ? 0 : 1 );
776776
Gia_ManStop( pTemp );
777777
// report
778-
nFlopsNew = Vec_IntCountEntry(pNew->vRegClasses, 1);
778+
nFlopsNew = pNew->vRegClasses ? Vec_IntCountEntry(pNew->vRegClasses, 1) : 0;
779779
pFlopTypes[2] = nFlops - nFlopsNew - (pFlopTypes[0] + pFlopTypes[1]);
780780
if ( fVerbEquivs )
781781
{

0 commit comments

Comments
 (0)