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/aig/gia | |
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/aig/gia')
-rw-r--r-- | src/aig/gia/giaAig.c | 2 | ||||
-rw-r--r-- | src/aig/gia/giaAiger.c | 3 | ||||
-rw-r--r-- | src/aig/gia/giaFront.c | 2 | ||||
-rw-r--r-- | src/aig/gia/giaIf.c | 4 | ||||
-rw-r--r-- | src/aig/gia/giaPat.c | 1 |
5 files changed, 9 insertions, 3 deletions
diff --git a/src/aig/gia/giaAig.c b/src/aig/gia/giaAig.c index 0e004f87..811a370b 100644 --- a/src/aig/gia/giaAig.c +++ b/src/aig/gia/giaAig.c @@ -331,7 +331,7 @@ Aig_Man_t * Gia_ManToAigSimple( Gia_Man_t * p ) Aig_Obj_t ** ppNodes; Gia_Obj_t * pObj; int i; - ppNodes = ABC_ALLOC( Aig_Obj_t *, Gia_ManObjNum(p) ); + ppNodes = ABC_FALLOC( Aig_Obj_t *, Gia_ManObjNum(p) ); // create the new manager pNew = Aig_ManStart( Gia_ManObjNum(p) ); pNew->pName = Gia_UtilStrsav( p->pName ); diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c index 07b81a86..14a2769e 100644 --- a/src/aig/gia/giaAiger.c +++ b/src/aig/gia/giaAiger.c @@ -365,8 +365,8 @@ Gia_Man_t * Gia_ReadAiger( char * pFileName, int fCheck ) // check if the input file format is correct if ( strncmp(pContents, "aig", 3) != 0 || (pContents[3] != ' ' && pContents[3] != '2') ) { + ABC_FREE( pContents ); fprintf( stdout, "Wrong input file format.\n" ); - free( pContents ); return NULL; } @@ -385,6 +385,7 @@ Gia_Man_t * Gia_ReadAiger( char * pFileName, int fCheck ) // check the parameters if ( nTotal != nInputs + nLatches + nAnds ) { + ABC_FREE( pContents ); fprintf( stdout, "The paramters are wrong.\n" ); return NULL; } diff --git a/src/aig/gia/giaFront.c b/src/aig/gia/giaFront.c index 6f1ce5a7..6eb20635 100644 --- a/src/aig/gia/giaFront.c +++ b/src/aig/gia/giaFront.c @@ -67,7 +67,7 @@ void Gia_ManFrontTransform( Gia_Man_t * p ) Gia_Obj_t * pObj; int i, * pFrontToId; // mapping of nodes into frontier variables assert( p->nFront > 0 ); - pFrontToId = ABC_ALLOC( int, p->nFront ); + pFrontToId = ABC_FALLOC( int, p->nFront ); Gia_ManForEachObj( p, pObj, i ) { if ( Gia_ObjIsCo(pObj) ) diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c index a06a6024..787aa090 100644 --- a/src/aig/gia/giaIf.c +++ b/src/aig/gia/giaIf.c @@ -262,10 +262,14 @@ int Gia_MappingIf( Gia_Man_t * p, If_Par_t * pPars ) vAigToIf = Vec_PtrStart( Gia_ManObjNum(p) ); pIfMan = Gia_ManToIf( p, pPars, vAigToIf ); if ( pIfMan == NULL ) + { + Vec_PtrFree( vAigToIf ); return 0; + } // pIfMan->pManTim = Tim_ManDup( pManTime, 0 ); if ( !If_ManPerformMapping( pIfMan ) ) { + Vec_PtrFree( vAigToIf ); If_ManStop( pIfMan ); return 0; } diff --git a/src/aig/gia/giaPat.c b/src/aig/gia/giaPat.c index bd43380f..643ae6b7 100644 --- a/src/aig/gia/giaPat.c +++ b/src/aig/gia/giaPat.c @@ -113,6 +113,7 @@ void Gia_SatVerifyPattern( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_Int_t * vCex, V Value = Gia_XsimAndCond( Value0, Gia_ObjFaninC0(pObj), Value1, Gia_ObjFaninC1(pObj) ); Sat_ObjSetXValue( pObj, Value ); } + Value = Sat_ObjXValue( Gia_ObjFanin0(pRoot) ); Value = Gia_XsimNotCond( Value, Gia_ObjFaninC0(pRoot) ); if ( Value != GIA_ONE ) printf( "Gia_SatVerifyPattern(): Verification FAILED.\n" ); |