From d548040437fafd77eece36db66d2da23b44e10b1 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 29 Feb 2012 16:15:31 -0800 Subject: Bug fix in a standard cell library generator. --- src/map/amap/amapPerm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/map/amap/amapPerm.c') 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 ); -- cgit v1.2.3