summaryrefslogtreecommitdiffstats
path: root/src/map/amap/amapPerm.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-02-23 10:24:01 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2012-02-23 10:24:01 -0800
commit99e7d1d19357acf9d317d3beababe48d709a7020 (patch)
tree195c8422ad933ed9553aa5d2330617146ee9ec77 /src/map/amap/amapPerm.c
parent1d25ae3b1a197a15cdba6c8c206bcd050608a4f0 (diff)
downloadabc-99e7d1d19357acf9d317d3beababe48d709a7020.tar.gz
abc-99e7d1d19357acf9d317d3beababe48d709a7020.tar.bz2
abc-99e7d1d19357acf9d317d3beababe48d709a7020.zip
Bug fix in stadard cell library representation.
Diffstat (limited to 'src/map/amap/amapPerm.c')
-rw-r--r--src/map/amap/amapPerm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map/amap/amapPerm.c b/src/map/amap/amapPerm.c
index 8af42ca3..7c471ca4 100644
--- a/src/map/amap/amapPerm.c
+++ b/src/map/amap/amapPerm.c
@@ -159,8 +159,15 @@ Vec_Int_t * Amap_LibDeriveGatePerm_rec( Amap_Lib_t * pLib, Kit_DsdNtk_t * pNtk,
iDsdLit = 0;
Vec_IntForEachEntry( vNodFanin, iNodFanin, k )
{
- if ( iNodFanin == 0 && iDsdLit < Vec_IntSize(vDsdLits) )
+ if ( iNodFanin == 0 )
{
+ if ( iDsdLit >= Vec_IntSize(vDsdLits) )
+ {
+ Vec_IntFree( vPerm );
+ Vec_IntFree( vDsdLits );
+ Vec_IntFree( vNodFanin );
+ return NULL;
+ }
iDsdFanin = Vec_IntEntry( vDsdLits, iDsdLit++ );
Vec_IntPush( vPerm, iDsdFanin );
continue;