File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -84,9 +84,11 @@ Gia_ManTer_t * Gia_ManTerCreate( Gia_Man_t * pAig )
8484 p = ABC_CALLOC ( Gia_ManTer_t , 1 );
8585 p -> pAig = Gia_ManFront ( pAig );
8686 p -> nIters = 300 ;
87- p -> pDataSim = ABC_ALLOC ( unsigned , Abc_BitWordNum (2 * p -> pAig -> nFront ) );
88- p -> pDataSimCis = ABC_ALLOC ( unsigned , Abc_BitWordNum (2 * Gia_ManCiNum (p -> pAig )) );
89- p -> pDataSimCos = ABC_ALLOC ( unsigned , Abc_BitWordNum (2 * Gia_ManCoNum (p -> pAig )) );
87+ // these buffers are accessed through XOR-based setters that read the current word first,
88+ // so they must be zero-initialized to avoid touching undefined data on the first update
89+ p -> pDataSim = ABC_CALLOC ( unsigned , Abc_BitWordNum (2 * p -> pAig -> nFront ) );
90+ p -> pDataSimCis = ABC_CALLOC ( unsigned , Abc_BitWordNum (2 * Gia_ManCiNum (p -> pAig )) );
91+ p -> pDataSimCos = ABC_CALLOC ( unsigned , Abc_BitWordNum (2 * Gia_ManCoNum (p -> pAig )) );
9092 // allocate storage for terminary states
9193 p -> nStateWords = Abc_BitWordNum ( 2 * Gia_ManRegNum (pAig ) );
9294 p -> vStates = Vec_PtrAlloc ( 1000 );
@@ -754,4 +756,3 @@ Gia_Man_t * Gia_ManReduceConst( Gia_Man_t * pAig, int fVerbose )
754756
755757
756758ABC_NAMESPACE_IMPL_END
757-
You can’t perform that action at this time.
0 commit comments