summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-02-10 10:55:38 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2015-02-10 10:55:38 -0800
commit6bda7ca8f4175b9dcdd4b033e17f42ed4faf6129 (patch)
tree64bc85279bd52f4481576a263c04d1bf4004204f /src/base
parent44b31021d6c45582738fa912aca86b9ab9ac054e (diff)
downloadabc-6bda7ca8f4175b9dcdd4b033e17f42ed4faf6129.tar.gz
abc-6bda7ca8f4175b9dcdd4b033e17f42ed4faf6129.tar.bz2
abc-6bda7ca8f4175b9dcdd4b033e17f42ed4faf6129.zip
Adding resource limit to 'fx'.
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abc/abcUtil.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/base/abc/abcUtil.c b/src/base/abc/abcUtil.c
index 9309f1e8..b1fc6855 100644
--- a/src/base/abc/abcUtil.c
+++ b/src/base/abc/abcUtil.c
@@ -138,17 +138,19 @@ int Abc_NtkGetCubeNum( Abc_Ntk_t * pNtk )
int Abc_NtkGetCubePairNum( Abc_Ntk_t * pNtk )
{
Abc_Obj_t * pNode;
- int i, nCubes, nCubePairs = 0;
+ int i;
+ word nCubes, nCubePairs = 0;
assert( Abc_NtkHasSop(pNtk) );
Abc_NtkForEachNode( pNtk, pNode, i )
{
if ( Abc_NodeIsConst(pNode) )
continue;
assert( pNode->pData );
- nCubes = Abc_SopGetCubeNum( (char *)pNode->pData );
- nCubePairs += nCubes * (nCubes - 1) / 2;
+ nCubes = (word)Abc_SopGetCubeNum( (char *)pNode->pData );
+ if ( nCubes > 1 )
+ nCubePairs += nCubes * (nCubes - 1) / 2;
}
- return nCubePairs;
+ return (int)(nCubePairs > (1<<30) ? (1<<30) : nCubePairs);
}
/**Function*************************************************************