summaryrefslogtreecommitdiffstats
path: root/src/aig
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig')
-rw-r--r--src/aig/aig/aigScl.c2
-rw-r--r--src/aig/aig/aigUtil.c1
-rw-r--r--src/aig/bbr/bbrReach.c2
-rw-r--r--src/aig/cec/cecSweep.c2
-rw-r--r--src/aig/fra/fraClass.c4
-rw-r--r--src/aig/gia/giaAig.c2
-rw-r--r--src/aig/gia/giaAiger.c3
-rw-r--r--src/aig/gia/giaFront.c2
-rw-r--r--src/aig/gia/giaIf.c4
-rw-r--r--src/aig/gia/giaPat.c1
-rw-r--r--src/aig/hop/hopUtil.c1
-rw-r--r--src/aig/ioa/ioaReadAig.c1
-rw-r--r--src/aig/ivy/ivyUtil.c1
-rw-r--r--src/aig/ntl/ntlEc.c4
-rw-r--r--src/aig/ntl/ntlReadBlif.c2
-rw-r--r--src/aig/saig/saigBmc2.c4
-rw-r--r--src/aig/saig/saigConstr.c4
-rw-r--r--src/aig/saig/saigPhase.c2
-rw-r--r--src/aig/saig/saigWnd.c2
-rw-r--r--src/aig/ssw/sswCore.c2
20 files changed, 29 insertions, 17 deletions
diff --git a/src/aig/aig/aigScl.c b/src/aig/aig/aigScl.c
index e31ab74b..549da741 100644
--- a/src/aig/aig/aigScl.c
+++ b/src/aig/aig/aigScl.c
@@ -400,7 +400,7 @@ Vec_Ptr_t * Aig_ManReduceLachesOnce( Aig_Man_t * p )
Aig_ManForEachPiSeq( p, pObj, i )
Vec_PtrPush( vMap, pObj );
// create mapping of fanin nodes into the corresponding latch outputs
- pMapping = ABC_ALLOC( int, 2 * Aig_ManObjNumMax(p) );
+ pMapping = ABC_FALLOC( int, 2 * Aig_ManObjNumMax(p) );
Aig_ManForEachLiLoSeq( p, pObjLi, pObjLo, i )
{
pFanin = Aig_ObjFanin0(pObjLi);
diff --git a/src/aig/aig/aigUtil.c b/src/aig/aig/aigUtil.c
index 1b97fb2c..1ce181ea 100644
--- a/src/aig/aig/aigUtil.c
+++ b/src/aig/aig/aigUtil.c
@@ -731,6 +731,7 @@ void Aig_ManPrintVerbose( Aig_Man_t * p, int fHaig )
Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
Aig_ObjPrintVerbose( pObj, fHaig ), printf( "\n" );
printf( "\n" );
+ Vec_PtrFree( vNodes );
}
/**Function*************************************************************
diff --git a/src/aig/bbr/bbrReach.c b/src/aig/bbr/bbrReach.c
index ef355992..9c6dced3 100644
--- a/src/aig/bbr/bbrReach.c
+++ b/src/aig/bbr/bbrReach.c
@@ -245,7 +245,7 @@ int Aig_ManComputeReachable( DdManager * dd, Aig_Man_t * p, DdNode ** pbParts, D
DdNode * bNext = NULL; // Suppress "might be used uninitialized"
DdNode * bTemp;
Cudd_ReorderingType method;
- int i, nIters, nBddSize, status;
+ int i, nIters, nBddSize = 0, status;
int nThreshold = 10000, clk = clock();
Vec_Ptr_t * vOnionRings;
diff --git a/src/aig/cec/cecSweep.c b/src/aig/cec/cecSweep.c
index 97f5e36a..7d59515e 100644
--- a/src/aig/cec/cecSweep.c
+++ b/src/aig/cec/cecSweep.c
@@ -45,7 +45,7 @@ ABC_NAMESPACE_IMPL_START
Gia_Man_t * Cec_ManFraSpecReduction( Cec_ManFra_t * p )
{
Gia_Man_t * pNew, * pTemp;
- Gia_Obj_t * pObj, * pRepr;
+ Gia_Obj_t * pObj, * pRepr = NULL;
int iRes0, iRes1, iRepr, iNode, iMiter;
int i, fCompl, * piCopies, * pDepths;
Gia_ManSetPhase( p->pAig );
diff --git a/src/aig/fra/fraClass.c b/src/aig/fra/fraClass.c
index 9b1ad3f2..8cf2a54d 100644
--- a/src/aig/fra/fraClass.c
+++ b/src/aig/fra/fraClass.c
@@ -281,8 +281,8 @@ void Fra_ClassesPrepare( Fra_Cla_t * p, int fLatchCorr, int nMaxLevs )
// allocate the hash table hashing simulation info into nodes
nTableSize = Aig_PrimeCudd( Aig_ManObjNumMax(p->pAig) );
- ppTable = ABC_ALLOC( Aig_Obj_t *, nTableSize );
- ppNexts = ABC_ALLOC( Aig_Obj_t *, nTableSize );
+ ppTable = ABC_FALLOC( Aig_Obj_t *, nTableSize );
+ ppNexts = ABC_FALLOC( Aig_Obj_t *, nTableSize );
memset( ppTable, 0, sizeof(Aig_Obj_t *) * nTableSize );
// add all the nodes to the hash table
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" );
diff --git a/src/aig/hop/hopUtil.c b/src/aig/hop/hopUtil.c
index 76ed7b17..17578f06 100644
--- a/src/aig/hop/hopUtil.c
+++ b/src/aig/hop/hopUtil.c
@@ -492,6 +492,7 @@ void Hop_ManPrintVerbose( Hop_Man_t * p, int fHaig )
Vec_PtrForEachEntry( Hop_Obj_t *, vNodes, pObj, i )
Hop_ObjPrintVerbose( pObj, fHaig ), printf( "\n" );
printf( "\n" );
+ Vec_PtrFree( vNodes );
}
/**Function*************************************************************
diff --git a/src/aig/ioa/ioaReadAig.c b/src/aig/ioa/ioaReadAig.c
index defaa752..096e82e4 100644
--- a/src/aig/ioa/ioaReadAig.c
+++ b/src/aig/ioa/ioaReadAig.c
@@ -116,7 +116,6 @@ Aig_Man_t * Ioa_ReadAigerFromMemory( char * pContents, int nFileSize, int fCheck
if ( strncmp(pContents, "aig", 3) != 0 || (pContents[3] != ' ' && pContents[3] != '2') )
{
fprintf( stdout, "Wrong input file format.\n" );
- free( pContents );
return NULL;
}
diff --git a/src/aig/ivy/ivyUtil.c b/src/aig/ivy/ivyUtil.c
index 4df67517..c8d4003a 100644
--- a/src/aig/ivy/ivyUtil.c
+++ b/src/aig/ivy/ivyUtil.c
@@ -732,6 +732,7 @@ void Ivy_ManPrintVerbose( Ivy_Man_t * p, int fHaig )
Ivy_ManForEachNodeVec( p, vNodes, pObj, i )
Ivy_ObjPrintVerbose( p, pObj, fHaig ), printf( "\n" );
printf( "\n" );
+ Vec_IntFree( vNodes );
}
/**Function*************************************************************
diff --git a/src/aig/ntl/ntlEc.c b/src/aig/ntl/ntlEc.c
index d82ac71e..331cd906 100644
--- a/src/aig/ntl/ntlEc.c
+++ b/src/aig/ntl/ntlEc.c
@@ -243,8 +243,6 @@ void Ntl_ManPrepareCecMans( Ntl_Man_t * pMan1, Ntl_Man_t * pMan2, Aig_Man_t ** p
Ntl_ManCreateMissingInputs( pModel1, pModel2, 0 );
if ( Ntl_ModelCombLeafNum(pModel1) != Ntl_ModelCombLeafNum(pModel2) )
{
- if ( pMan1 ) Ntl_ManFree( pMan1 );
- if ( pMan2 ) Ntl_ManFree( pMan2 );
printf( "Ntl_ManPrepareCec(): Cannot verify designs with too many different CIs.\n" );
return;
}
@@ -253,8 +251,6 @@ void Ntl_ManPrepareCecMans( Ntl_Man_t * pMan1, Ntl_Man_t * pMan2, Aig_Man_t ** p
if ( Vec_PtrSize(pMan1->vCos) == 0 )
{
printf( "Ntl_ManPrepareCec(): There is no identically-named primary outputs to compare.\n" );
- if ( pMan1 ) Ntl_ManFree( pMan1 );
- if ( pMan2 ) Ntl_ManFree( pMan2 );
return;
}
// derive AIGs
diff --git a/src/aig/ntl/ntlReadBlif.c b/src/aig/ntl/ntlReadBlif.c
index 103f8540..88962efa 100644
--- a/src/aig/ntl/ntlReadBlif.c
+++ b/src/aig/ntl/ntlReadBlif.c
@@ -444,6 +444,7 @@ static char * Ntl_ReadLoadFile( char * pFileName )
pFile = fopen( pFileName, "rb" );
if ( pFile == NULL )
{
+ fclose( pFile );
printf( "Ntl_ReadLoadFile(): The file is unavailable (absent or open).\n" );
return NULL;
}
@@ -451,6 +452,7 @@ static char * Ntl_ReadLoadFile( char * pFileName )
nFileSize = ftell( pFile );
if ( nFileSize == 0 )
{
+ fclose( pFile );
printf( "Ntl_ReadLoadFile(): The file is empty.\n" );
return NULL;
}
diff --git a/src/aig/saig/saigBmc2.c b/src/aig/saig/saigBmc2.c
index 9c36deb3..8e537142 100644
--- a/src/aig/saig/saigBmc2.c
+++ b/src/aig/saig/saigBmc2.c
@@ -751,7 +751,7 @@ int Saig_BmcPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, int nNodesMax
Aig_Man_t * pNew;
Cnf_Dat_t * pCnf;
int nOutsSolved = 0;
- int Iter, RetValue, clk = clock(), clk2, clkTotal = clock();
+ int Iter, RetValue = -1, clk = clock(), clk2, clkTotal = clock();
int Status = -1;
/*
Vec_Ptr_t * vSimInfo;
@@ -801,9 +801,9 @@ int Saig_BmcPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, int nNodesMax
if ( nTimeOut && ((float)nTimeOut <= (float)(clock()-clkTotal)/(float)(CLOCKS_PER_SEC)) )
{
printf( "Reached timeout (%d seconds).\n", nTimeOut );
- Saig_BmcManStop( p );
if ( piFrames )
*piFrames = p->iFrameLast-1;
+ Saig_BmcManStop( p );
return Status;
}
}
diff --git a/src/aig/saig/saigConstr.c b/src/aig/saig/saigConstr.c
index b4024634..d58074e3 100644
--- a/src/aig/saig/saigConstr.c
+++ b/src/aig/saig/saigConstr.c
@@ -57,7 +57,11 @@ Aig_Man_t * Saig_ManDupUnfoldConstrs( Aig_Man_t * pAig )
int i, RetValue;
RetValue = Saig_ManDetectConstr( pAig, &vOuts, &vCons );
if ( RetValue == 0 )
+ {
+ Vec_PtrFreeP( &vOuts );
+ Vec_PtrFreeP( &vCons );
return Aig_ManDupDfs( pAig );
+ }
// start the new manager
pAigNew = Aig_ManStart( Aig_ManNodeNum(pAig) );
pAigNew->pName = Aig_UtilStrsav( pAig->pName );
diff --git a/src/aig/saig/saigPhase.c b/src/aig/saig/saigPhase.c
index fad77020..1c288407 100644
--- a/src/aig/saig/saigPhase.c
+++ b/src/aig/saig/saigPhase.c
@@ -665,7 +665,7 @@ void Saig_ManAnalizeControl( Aig_Man_t * p, int Reg )
***********************************************************************/
int Saig_ManFindRegisters( Saig_Tsim_t * pTsi, int nFrames, int fIgnore, int fVerbose )
{
- int Values[257];
+ int Values[257] = {0};
unsigned * pState;
int r, i, k, Reg, Value;
int nTests = pTsi->nPrefix + 2 * pTsi->nCycle;
diff --git a/src/aig/saig/saigWnd.c b/src/aig/saig/saigWnd.c
index eeacb44e..c11798ea 100644
--- a/src/aig/saig/saigWnd.c
+++ b/src/aig/saig/saigWnd.c
@@ -802,6 +802,8 @@ Aig_Man_t * Saig_ManWindowExtractMiter( Aig_Man_t * p0, Aig_Man_t * p1 )
}
Aig_ManSetRegNum( pNew, nRegCount );
Aig_ManCleanup( pNew );
+ Vec_PtrFree( vNodes0 );
+ Vec_PtrFree( vNodes1 );
return pNew;
}
diff --git a/src/aig/ssw/sswCore.c b/src/aig/ssw/sswCore.c
index 1419b889..76cc34fa 100644
--- a/src/aig/ssw/sswCore.c
+++ b/src/aig/ssw/sswCore.c
@@ -234,7 +234,7 @@ Aig_Man_t * Ssw_SignalCorrespondenceRefine( Ssw_Man_t * p )
{
int nSatProof, nSatCallsSat, nRecycles, nSatFailsReal, nUniques;
Aig_Man_t * pAigNew;
- int RetValue, nIter;
+ int RetValue, nIter = -1;
int clk, clkTotal = clock();
// get the starting stats
p->nLitsBeg = Ssw_ClassesLitNum( p->ppClasses );