From 5b8fa41ba966271f97f99860b21eee83bf51e61a Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 21 Jan 2022 11:33:53 -0800 Subject: Suggested bug fixes in the old code. --- src/aig/aig/aigUtil.c | 2 +- src/aig/gia/giaCex.c | 2 +- src/aig/ioa/ioaReadAig.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/aig') 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 ); -- cgit v1.2.3