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

[buddy] Remove some valgrind warnings about uninitialized memory when

BddCache_lookup return an entry from a Not operation.

* src/bddop.c (apply_rec, simplify_rec): When checking the cache
entry, always check entry->a and entry->c before checking
entry->b, because the "not_rec()" function does not initialize
the latter.
parent a0ca684d
2011-06-09 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Remove some valgrind warnings about uninitialized memory when
BddCache_lookup return an entry from a Not operation.
* src/bddop.c (apply_rec, simplify_rec): When checking the cache
entry, always check entry->a and entry->c before checking
entry->b, because the "not_rec()" function does not initialize
the latter.
2011-06-07 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* examples/cmilner/cmilner.c (A, transitions, initial_state)
......
......@@ -619,7 +619,8 @@ static BDD apply_rec(BDD l, BDD r)
{
entry = BddCache_lookup(&applycache, APPLYHASH(l,r,applyop));
if (entry->a == l && entry->b == r && entry->c == applyop)
// Check entry->c last, because not_rec() does not initialize it.
if (entry->a == l && entry->c == applyop && entry->b == r)
{
#ifdef CACHESTATS
bddcachestats.opHit++;
......@@ -1649,7 +1650,8 @@ static BDD simplify_rec(BDD f, BDD d)
entry = BddCache_lookup(&applycache, APPLYHASH(f,d,bddop_simplify));
if (entry->a == f && entry->b == d && entry->c == bddop_simplify)
// Check entry->c last, because not_rec() does not initialize it.
if (entry->a == f && entry->c == bddop_simplify && entry->b == d)
{
#ifdef CACHESTATS
bddcachestats.opHit++;
......
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