mirror of https://github.com/YosysHQ/abc.git
Merge pull request #539 from marcelwa/acd-uninit-bestperm
acd: uninitialised read of bestPerm in enumerate_iset_combinations
This commit is contained in:
commit
25b0e5399c
|
|
@ -482,6 +482,11 @@ private:
|
|||
for ( uint32_t i = 0; i < num_vars; ++i )
|
||||
{
|
||||
pComb[i] = pInvPerm[i] = i;
|
||||
/* bestPerm is written only when some combination beats the initial
|
||||
* best_cost. When none does, the loop below still evaluates
|
||||
* permutations[bestPerm[i]], which reads uninitialised stack and then
|
||||
* indexes permutations[] with it. Seed the identity permutation. */
|
||||
bestPerm[i] = i;
|
||||
}
|
||||
|
||||
/* early bail-out conditions */
|
||||
|
|
|
|||
Loading…
Reference in New Issue