From c1ed182d38d2c9dd22f5d531337167ec38c18a15 Mon Sep 17 00:00:00 2001 From: phyzhenli <48823046+phyzhenli@users.noreply.github.com> Date: Tue, 6 Jan 2026 10:34:26 +0800 Subject: [PATCH] Fix &synch2 crash with creating wrong mapping --- src/aig/gia/giaLf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/aig/gia/giaLf.c b/src/aig/gia/giaLf.c index 130660050..3732794ee 100644 --- a/src/aig/gia/giaLf.c +++ b/src/aig/gia/giaLf.c @@ -1838,6 +1838,12 @@ static inline int Lf_ManDerivePart( Lf_Man_t * p, Gia_Man_t * pNew, Vec_Int_t * } pTruth = Lf_CutTruth( p, pCut ); iLit = Kit_TruthToGia( pNew, (unsigned *)pTruth, Vec_IntSize(vLeaves), vCover, vLeaves, 0 ); + // do not create LUT in the simple case + if ( Abc_Lit2Var(iLit) == 0 ) + return iLit; + Vec_IntForEachEntry( vLeaves, iTemp, k ) + if ( Abc_Lit2Var(iLit) == Abc_Lit2Var(iTemp) ) + return iLit; // create mapping Vec_IntSetEntry( vMapping, Abc_Lit2Var(iLit), Vec_IntSize(vMapping2) ); Vec_IntPush( vMapping2, Vec_IntSize(vLeaves) );