summaryrefslogtreecommitdiffstats
path: root/src/map/amap
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-02-29 16:15:31 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2012-02-29 16:15:31 -0800
commitd548040437fafd77eece36db66d2da23b44e10b1 (patch)
tree1fffc3be8645410975a7bc1997012fec1783e33c /src/map/amap
parent4b647de7fd069b03f8c77b9563040424521c2453 (diff)
downloadabc-d548040437fafd77eece36db66d2da23b44e10b1.tar.gz
abc-d548040437fafd77eece36db66d2da23b44e10b1.tar.bz2
abc-d548040437fafd77eece36db66d2da23b44e10b1.zip
Bug fix in a standard cell library generator.
Diffstat (limited to 'src/map/amap')
-rw-r--r--src/map/amap/amapPerm.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/map/amap/amapPerm.c b/src/map/amap/amapPerm.c
index c5885c1f..a16e8979 100644
--- a/src/map/amap/amapPerm.c
+++ b/src/map/amap/amapPerm.c
@@ -114,7 +114,10 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk,
pNodFanin = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan0) );
vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, iDsdFanin, pNodFanin );
if ( vPermFanin == NULL )
+ {
+ Vec_IntFree( vPerm );
return NULL;
+ }
Vec_IntForEachEntry( vPermFanin, Value, k )
Vec_IntPush( vPerm, Value );
Vec_IntFree( vPermFanin );
@@ -123,7 +126,10 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk,
pNodFanin = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan1) );
vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, iDsdFanin, pNodFanin );
if ( vPermFanin == NULL )
+ {
+ Vec_IntFree( vPerm );
return NULL;
+ }
Vec_IntForEachEntry( vPermFanin, Value, k )
Vec_IntPush( vPerm, Value );
Vec_IntFree( vPermFanin );
@@ -132,7 +138,10 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk,
pNodFanin = Amap_LibNod( pLib, Abc_Lit2Var(pNod->iFan2) );
vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, iDsdFanin, pNodFanin );
if ( vPermFanin == NULL )
+ {
+ Vec_IntFree( vPerm );
return NULL;
+ }
Vec_IntForEachEntry( vPermFanin, Value, k )
Vec_IntPush( vPerm, Value );
Vec_IntFree( vPermFanin );
@@ -193,7 +202,12 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk,
continue;
vPermFanin = Amap_LibDeriveGatePerm_rec( pLib, pNtk, Abc_LitRegular(iDsdFanin), pNodFanin );
if ( vPermFanin == NULL )
- continue;
+ {
+ Vec_IntFree( vNodFanin );
+ Vec_IntFree( vDsdLits );
+ Vec_IntFree( vPerm );
+ return NULL;
+ }
pDsdFanin->fMark = 1;
Vec_IntForEachEntry( vPermFanin, Value, j )
Vec_IntPush( vPerm, Value );