Merge pull request #465 from zeldin/flipvar5_fix

Fix memory corruption in &mfs.
This commit is contained in:
alanminko 2025-12-24 07:24:54 -08:00 committed by GitHub
commit fd04a1c073
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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;
}