Fix memory corruption in &mfs.

This commit is contained in:
Marcus Comstedt 2025-12-24 10:30:38 +01:00
parent 64637b8395
commit c0e252846e
1 changed files with 6 additions and 3 deletions

View File

@ -111,8 +111,10 @@ int Sfm_TruthToCnf( word Truth, word * pTruth, int nVars, Vec_Int_t * vCover, Ve
int i, k, c, RetValue, Literal, Cube, nCubes = 0;
assert( nVars > 0 );
Abc_TtFlipVar5( &Truth, nVars );
Abc_TtFlipVar5( pTruth, nVars );
if ( nVars <= 6)
Abc_TtFlipVar5( &Truth, nVars );
else
Abc_TtFlipVar5( pTruth, nVars );
for ( c = 0; c < 2; c ++ )
{
if ( nVars <= 6 )
@ -148,7 +150,8 @@ int Sfm_TruthToCnf( word Truth, word * pTruth, int nVars, Vec_Int_t * vCover, Ve
Vec_StrPush( vCnf, (char)-1 );
}
}
Abc_TtFlipVar5( pTruth, nVars );
if (nVars > 6)
Abc_TtFlipVar5( pTruth, nVars );
return nCubes;
}