Skip to content

Commit ba55a2f

Browse files
danpoemartin
authored and
martin
committed
constant propagator fix
1 parent 350aa96 commit ba55a2f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/analyses/constant_propagator.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,17 @@ void constant_propagator_domaint::transform(
5858
output(std::cout, ai, ns);
5959
#endif
6060

61+
// When the domain is used with constant_propagator_ait,
62+
// information about dirty variables and config flags are
63+
// available. Otherwise, the below will be null and we use default
64+
// values
6165
const constant_propagator_ait *cp=
6266
dynamic_cast<constant_propagator_ait *>(&ai);
6367
bool have_dirty=(cp!=nullptr);
6468

65-
assert(!values.is_bottom);
69+
// INVARIANT(!values.is_bottom);
70+
if(values.is_bottom)
71+
return;
6672

6773
if(from->is_decl())
6874
{
@@ -315,7 +321,7 @@ bool constant_propagator_domaint::valuest::set_to_top(const irep_idt &id)
315321
replace_symbolt::expr_mapt::size_type n_erased=
316322
replace_const.expr_map.erase(id);
317323

318-
INVARIANT(n_erased==0 || !is_bottom, "bottom => 0 erased");
324+
INVARIANT(n_erased==0 || !is_bottom, "bottom should have no elements at all");
319325

320326
return n_erased>0;
321327
}

0 commit comments

Comments
 (0)