Commit 1244b617 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

[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.
parent 55715dfb
......@@ -917,7 +917,8 @@ int bdd_implies(BDD l, BDD r)
return 0;
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
bddcachestats.opHit++;
......@@ -1758,7 +1759,7 @@ static BDD simplify_rec(BDD f, BDD d)
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)
{
#ifdef CACHESTATS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment