[buddy] Fix a harmless uninitialized read.
This can only cause failure when running under valgrind (i.e., in the test suite), but is not a problem in practice as the test is certain to fail the entry->c check whenever entry->b is uninitialized. * src/bddop.c (bdd_implies): Here.
This commit is contained in:
parent
55715dfb87
commit
1244b61710
1 changed files with 3 additions and 2 deletions
|
|
@ -917,7 +917,8 @@ int bdd_implies(BDD l, BDD r)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
entry = BddCache_lookup(&misccache, IMPLIESHASH(l,r));
|
entry = BddCache_lookup(&misccache, IMPLIESHASH(l,r));
|
||||||
if (entry->a == l && entry->b == r && entry->c == CACHEID_IMPLIES)
|
// Check entry->b last, because not_rec() does not initialize it.
|
||||||
|
if (entry->a == l && entry->c == CACHEID_IMPLIES && entry->b == r)
|
||||||
{
|
{
|
||||||
#ifdef CACHESTATS
|
#ifdef CACHESTATS
|
||||||
bddcachestats.opHit++;
|
bddcachestats.opHit++;
|
||||||
|
|
@ -1758,7 +1759,7 @@ static BDD simplify_rec(BDD f, BDD d)
|
||||||
|
|
||||||
entry = BddCache_lookup(&applycache, APPLYHASH(f,d,bddop_simplify));
|
entry = BddCache_lookup(&applycache, APPLYHASH(f,d,bddop_simplify));
|
||||||
|
|
||||||
// Check entry->c last, because not_rec() does not initialize it.
|
// Check entry->b last, because not_rec() does not initialize it.
|
||||||
if (entry->a == f && entry->c == bddop_simplify && entry->b == d)
|
if (entry->a == f && entry->c == bddop_simplify && entry->b == d)
|
||||||
{
|
{
|
||||||
#ifdef CACHESTATS
|
#ifdef CACHESTATS
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue