diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2011-03-27 14:17:12 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2011-03-27 14:17:12 -0700 |
commit | 6c01e8b9f040d591f72882aff08ed21446fbb567 (patch) | |
tree | 71f04dae22291d7321e5bb244462ab1145c47ee6 /src/base/abci | |
parent | 1ec437d04b2fcb42054f068525c2a1b21b69fe53 (diff) | |
download | abc-6c01e8b9f040d591f72882aff08ed21446fbb567.tar.gz abc-6c01e8b9f040d591f72882aff08ed21446fbb567.tar.bz2 abc-6c01e8b9f040d591f72882aff08ed21446fbb567.zip |
Fixed a number of small bugs and memory leaks.
Diffstat (limited to 'src/base/abci')
-rw-r--r-- | src/base/abci/abc.c | 10 | ||||
-rw-r--r-- | src/base/abci/abcDsd.c | 7 | ||||
-rw-r--r-- | src/base/abci/abcVerify.c | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 8443ef83..b8c8f7a0 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -2103,7 +2103,7 @@ int Abc_CommandPrintDsd( Abc_Frame_t * pAbc, int argc, char ** argv ) // convert it to truth table { Abc_Obj_t * pObj = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) ); - Vec_Int_t * vMemory = Vec_IntAlloc(0); + Vec_Int_t * vMemory; unsigned * pTruth; if ( !Abc_ObjIsNode(pObj) ) { @@ -2115,6 +2115,7 @@ int Abc_CommandPrintDsd( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -1, "Currently works only for up to 16 inputs.\n" ); return 1; } + vMemory = Vec_IntAlloc(0); pTruth = Hop_ManConvertAigToTruth( (Hop_Man_t *)pNtk->pManFunc, Hop_Regular((Hop_Obj_t *)pObj->pData), Abc_ObjFaninNum(pObj), vMemory, 0 ); if ( Hop_IsComplement((Hop_Obj_t *)pObj->pData) ) Extra_TruthNot( pTruth, pTruth, Abc_ObjFaninNum(pObj) ); @@ -5581,7 +5582,7 @@ usage: int Abc_CommandOrPos( Abc_Frame_t * pAbc, int argc, char ** argv ) { Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes; - int fComb; + int fComb = 0; int c; extern int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd ); @@ -5656,7 +5657,7 @@ usage: int Abc_CommandAndPos( Abc_Frame_t * pAbc, int argc, char ** argv ) { Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes; - int fComb; + int fComb = 0; int c; // set defaults @@ -5932,7 +5933,7 @@ int Abc_CommandAppend( Abc_Frame_t * pAbc, int argc, char ** argv ) { Abc_Ntk_t * pNtk, * pNtk2; char * FileName; - int fComb; + int fComb = 0; int c; pNtk = Abc_FrameReadNtk(pAbc); @@ -5972,6 +5973,7 @@ int Abc_CommandAppend( Abc_Frame_t * pAbc, int argc, char ** argv ) // check if the second network is combinational if ( Abc_NtkLatchNum(pNtk2) ) { + Abc_NtkDelete( pNtk2 ); Abc_Print( -1, "The second network has latches. Appending does not work for such networks.\n" ); return 0; } diff --git a/src/base/abci/abcDsd.c b/src/base/abci/abcDsd.c index 558d9349..250cac14 100644 --- a/src/base/abci/abcDsd.c +++ b/src/base/abci/abcDsd.c @@ -113,14 +113,15 @@ Abc_Ntk_t * Abc_NtkDsdInternal( Abc_Ntk_t * pNtk, int fVerbose, int fPrint, int // perform the decomposition dd = (DdManager *)Abc_NtkGlobalBddMan(pNtk); pManDsd = Dsd_ManagerStart( dd, Abc_NtkCiNum(pNtk), fVerbose ); - Dsd_Decompose( pManDsd, (DdNode **)vFuncsGlob->pArray, Abc_NtkCoNum(pNtk) ); - Vec_PtrFree( vFuncsGlob ); - Abc_NtkFreeGlobalBdds( pNtk, 0 ); if ( pManDsd == NULL ) { + Vec_PtrFree( vFuncsGlob ); Cudd_Quit( dd ); return NULL; } + Dsd_Decompose( pManDsd, (DdNode **)vFuncsGlob->pArray, Abc_NtkCoNum(pNtk) ); + Vec_PtrFree( vFuncsGlob ); + Abc_NtkFreeGlobalBdds( pNtk, 0 ); // start the new network pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD ); diff --git a/src/base/abci/abcVerify.c b/src/base/abci/abcVerify.c index acdfcd93..7a9a5239 100644 --- a/src/base/abci/abcVerify.c +++ b/src/base/abci/abcVerify.c @@ -1031,7 +1031,7 @@ int Abc_NtkIsTrueCex( Abc_Ntk_t * pNtk, Abc_Cex_t * pCex ) { extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters ); Aig_Man_t * pMan; - int status, fStrashed = 0; + int status = 0, fStrashed = 0; if ( !Abc_NtkIsStrash(pNtk) ) { pNtk = Abc_NtkStrash(pNtk, 0, 0, 0); |