summaryrefslogtreecommitdiffstats
path: root/src/map
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2022-01-21 11:33:53 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2022-01-21 11:33:53 -0800
commit5b8fa41ba966271f97f99860b21eee83bf51e61a (patch)
treea1cdff81fb35c7fb36fd856b42d4cdb47c4adcad /src/map
parentd892e63256063ba04f20ca347121116bc67a30e2 (diff)
downloadabc-5b8fa41ba966271f97f99860b21eee83bf51e61a.tar.gz
abc-5b8fa41ba966271f97f99860b21eee83bf51e61a.tar.bz2
abc-5b8fa41ba966271f97f99860b21eee83bf51e61a.zip
Suggested bug fixes in the old code.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/amap/amapUniq.c7
1 files changed, 3 insertions, 4 deletions
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 )
{