diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2022-01-21 11:33:53 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2022-01-21 11:33:53 -0800 |
commit | 5b8fa41ba966271f97f99860b21eee83bf51e61a (patch) | |
tree | a1cdff81fb35c7fb36fd856b42d4cdb47c4adcad | |
parent | d892e63256063ba04f20ca347121116bc67a30e2 (diff) | |
download | abc-5b8fa41ba966271f97f99860b21eee83bf51e61a.tar.gz abc-5b8fa41ba966271f97f99860b21eee83bf51e61a.tar.bz2 abc-5b8fa41ba966271f97f99860b21eee83bf51e61a.zip |
Suggested bug fixes in the old code.
-rw-r--r-- | src/aig/aig/aigUtil.c | 2 | ||||
-rw-r--r-- | src/aig/gia/giaCex.c | 2 | ||||
-rw-r--r-- | src/aig/ioa/ioaReadAig.c | 2 | ||||
-rw-r--r-- | src/base/abci/abcExact.c | 2 | ||||
-rw-r--r-- | src/base/wlc/wlcMem.c | 2 | ||||
-rw-r--r-- | src/map/amap/amapUniq.c | 7 |
6 files changed, 8 insertions, 9 deletions
diff --git a/src/aig/aig/aigUtil.c b/src/aig/aig/aigUtil.c index 52f9a184..68be112f 100644 --- a/src/aig/aig/aigUtil.c +++ b/src/aig/aig/aigUtil.c @@ -1333,7 +1333,7 @@ void Aig_ManCounterExampleValueStart( Aig_Man_t * pAig, Abc_Cex_t * pCex ) pAig->pData2 = ABC_CALLOC( unsigned, Abc_BitWordNum( (pCex->iFrame + 1) * Aig_ManObjNumMax(pAig) ) ); // the register values in the counter-example should be zero Saig_ManForEachLo( pAig, pObj, k ) - assert( Abc_InfoHasBit(pCex->pData, iBit++) == 0 ); + assert( Abc_InfoHasBit(pCex->pData, iBit) == 0 ), iBit++; // iterate through the timeframes nObjs = Aig_ManObjNumMax(pAig); for ( i = 0; i <= pCex->iFrame; i++ ) diff --git a/src/aig/gia/giaCex.c b/src/aig/gia/giaCex.c index b0e72284..d1241873 100644 --- a/src/aig/gia/giaCex.c +++ b/src/aig/gia/giaCex.c @@ -195,7 +195,7 @@ void Gia_ManCounterExampleValueStart( Gia_Man_t * pGia, Abc_Cex_t * pCex ) pGia->pData2 = ABC_CALLOC( unsigned, Abc_BitWordNum( (pCex->iFrame + 1) * Gia_ManObjNum(pGia) ) ); // the register values in the counter-example should be zero Gia_ManForEachRo( pGia, pObj, k ) - assert( Abc_InfoHasBit(pCex->pData, iBit++) == 0 ); + assert( Abc_InfoHasBit(pCex->pData, iBit) == 0 ), iBit++; // iterate through the timeframes nObjs = Gia_ManObjNum(pGia); for ( i = 0; i <= pCex->iFrame; i++ ) diff --git a/src/aig/ioa/ioaReadAig.c b/src/aig/ioa/ioaReadAig.c index 1d1dcbe2..c1eceef0 100644 --- a/src/aig/ioa/ioaReadAig.c +++ b/src/aig/ioa/ioaReadAig.c @@ -438,7 +438,7 @@ Aig_Man_t * Ioa_ReadAiger( char * pFileName, int fCheck ) // read the file into the buffer nFileSize = Ioa_FileSize( pFileName ); pFile = fopen( pFileName, "rb" ); - pContents = ABC_ALLOC( char, nFileSize ); + pContents = ABC_CALLOC( char, nFileSize+1 ); RetValue = fread( pContents, nFileSize, 1, pFile ); fclose( pFile ); diff --git a/src/base/abci/abcExact.c b/src/base/abci/abcExact.c index 42cf11c5..64225c61 100644 --- a/src/base/abci/abcExact.c +++ b/src/base/abci/abcExact.c @@ -1034,7 +1034,7 @@ static word * Ses_ManDeriveTruth( Ses_Man_t * pSes, char * pSol, int fInvert ) for ( i = 0; i < nGates; ++i ) { f = *p++; - assert( *p++ == 2 ); + assert( *p == 2 ), p++; j = *p++; k = *p++; diff --git a/src/base/wlc/wlcMem.c b/src/base/wlc/wlcMem.c index da0fc846..b2d5c5ee 100644 --- a/src/base/wlc/wlcMem.c +++ b/src/base/wlc/wlcMem.c @@ -800,7 +800,7 @@ void Wlc_NtkTrace_rec( Wlc_Ntk_t * p, Wlc_Obj_t * pObj, int iFrame, Vec_Int_t * { int Index = 3*(iFrame*Vec_IntSize(vMemObjs) + iNum); int Value = (int)Vec_WrdEntry( vValues, Index ); - assert( Value == 0 && Value == 1 ); + assert( Value == 0 || Value == 1 ); Wlc_NtkTrace_rec( p, Value ? Wlc_ObjFanin2(p, pObj) : Wlc_ObjFanin1(p, pObj), iFrame, vMemObjs, vValues, ValueA, vRes ); Vec_IntPush( vRes, (iObj << 11) | (iFrame << 1) | Value ); } diff --git a/src/map/amap/amapUniq.c b/src/map/amap/amapUniq.c index dd858c96..e2be4343 100644 --- a/src/map/amap/amapUniq.c +++ b/src/map/amap/amapUniq.c @@ -278,15 +278,14 @@ Abc_Lit2Var(iFan2), (Abc_LitIsCompl(iFan2)?'-':'+') ); int ** Amap_LibLookupTableAlloc( Vec_Ptr_t * vVec, int fVerbose ) { Vec_Int_t * vOne; - int ** pRes, * pBuffer; + int ** pRes; int i, k, nTotal, nSize, nEntries, Value; // count the total size nEntries = nSize = Vec_PtrSize( vVec ); Vec_PtrForEachEntry( Vec_Int_t *, vVec, vOne, i ) nEntries += Vec_IntSize(vOne); - pBuffer = ABC_ALLOC( int, nSize * sizeof(void *) + nEntries ); - pRes = (int **)pBuffer; - pRes[0] = pBuffer + nSize * sizeof(void *); + pRes = (int **)ABC_ALLOC( char, nSize * sizeof(void *) + nEntries * sizeof(int) ); + pRes[0] = (int *)((char *)pRes + nSize * sizeof(void *)); nTotal = 0; Vec_PtrForEachEntry( Vec_Int_t *, vVec, vOne, i ) { |