summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-05-06 22:52:56 +0800
committerAlan Mishchenko <alanmi@berkeley.edu>2012-05-06 22:52:56 +0800
commit50fac8a0987244b1e3684ad62a8afc6c14e36193 (patch)
tree9ffeca3d6e49f11d9b19dc8e7ea1f52decd879cd
parentd4399dbf929b9c273b187580566ab41ac9ab955d (diff)
downloadabc-50fac8a0987244b1e3684ad62a8afc6c14e36193.tar.gz
abc-50fac8a0987244b1e3684ad62a8afc6c14e36193.tar.bz2
abc-50fac8a0987244b1e3684ad62a8afc6c14e36193.zip
Bug fix in fraig_restore.
-rw-r--r--src/base/abci/abcFraig.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/base/abci/abcFraig.c b/src/base/abci/abcFraig.c
index e1c12b3f..5ca34ba1 100644
--- a/src/base/abci/abcFraig.c
+++ b/src/base/abci/abcFraig.c
@@ -712,9 +712,12 @@ Abc_Ntk_t * Abc_NtkFraigRestore()
// swap the first and last network
// this should lead to the primary choice being "better" because of synthesis
- pNtk = (Abc_Ntk_t *)Vec_PtrPop( vStore );
- Vec_PtrPush( vStore, Vec_PtrEntry(vStore,0) );
- Vec_PtrWriteEntry( vStore, 0, pNtk );
+ if ( Vec_PtrSize(vStore) > 1 )
+ {
+ pNtk = (Abc_Ntk_t *)Vec_PtrPop( vStore );
+ Vec_PtrPush( vStore, Vec_PtrEntry(vStore,0) );
+ Vec_PtrWriteEntry( vStore, 0, pNtk );
+ }
// to determine the number of simulation patterns
// use the following strategy