Commit aaacf573 by Baruch Sterin

pyabc: fix _cex_put to not call Abc_CexDup() twice

parent 43d54351
...@@ -217,32 +217,32 @@ Abc_Cex_t* _cex_get() ...@@ -217,32 +217,32 @@ Abc_Cex_t* _cex_get()
int _cex_get_vec_len() int _cex_get_vec_len()
{ {
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Vec_Ptr_t* vCexVec = Abc_FrameReadCexVec(pAbc); Vec_Ptr_t* vCexVec = Abc_FrameReadCexVec(pAbc);
if( ! vCexVec ) if( ! vCexVec )
{ {
return 0; return 0;
} }
return Vec_PtrSize(vCexVec); return Vec_PtrSize(vCexVec);
} }
Abc_Cex_t* _cex_get_vec(int i) Abc_Cex_t* _cex_get_vec(int i)
{ {
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Vec_Ptr_t* vCexVec = Abc_FrameReadCexVec(pAbc); Vec_Ptr_t* vCexVec = Abc_FrameReadCexVec(pAbc);
if( ! vCexVec )
{
return NULL;
}
Abc_Cex_t* pCex = Vec_PtrEntry( vCexVec, i ); if( ! vCexVec )
{
return NULL;
}
Abc_Cex_t* pCex = Vec_PtrEntry( vCexVec, i );
if ( ! pCex ) if ( ! pCex )
{ {
return NULL; return NULL;
} }
return Abc_CexDup( pCex, -1 ); return Abc_CexDup( pCex, -1 );
} }
...@@ -254,7 +254,7 @@ void _cex_put(Abc_Cex_t* pCex) ...@@ -254,7 +254,7 @@ void _cex_put(Abc_Cex_t* pCex)
pCex = Abc_CexDup(pCex, -1); pCex = Abc_CexDup(pCex, -1);
} }
Abc_FrameSetCex( Abc_CexDup(pCex, -1) ); Abc_FrameSetCex( pCex );
} }
void _cex_free(Abc_Cex_t* pCex) void _cex_free(Abc_Cex_t* pCex)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment