@@ -100,7 +100,7 @@ void constant_propagator_domaint::assign_rec(
100100 exprt tmp = rhs;
101101 partial_evaluate (dest_values, tmp, ns);
102102
103- if (dest_values.is_constant (tmp))
103+ if (dest_values.is_constant (tmp, ns ))
104104 {
105105 DATA_INVARIANT (
106106 ns.lookup (s).type == tmp.type (),
@@ -393,7 +393,7 @@ bool constant_propagator_domaint::two_way_propagate_rec(
393393 // two-way propagation
394394 valuest copy_values=values;
395395 assign_rec (copy_values, lhs, rhs, ns, cp, false );
396- if (!values.is_constant (rhs) || values.is_constant (lhs))
396+ if (!values.is_constant (rhs, ns ) || values.is_constant (lhs, ns ))
397397 assign_rec (values, rhs, lhs, ns, cp, false );
398398 change = values.meet (copy_values, ns);
399399 }
@@ -419,9 +419,10 @@ bool constant_propagator_domaint::ai_simplify(
419419class constant_propagator_is_constantt : public is_constantt
420420{
421421public:
422- explicit constant_propagator_is_constantt (
423- const replace_symbolt &replace_const)
424- : replace_const(replace_const)
422+ constant_propagator_is_constantt (
423+ const replace_symbolt &replace_const,
424+ const namespacet &ns)
425+ : is_constantt(ns), replace_const(replace_const)
425426 {
426427 }
427428
@@ -442,14 +443,18 @@ class constant_propagator_is_constantt : public is_constantt
442443 const replace_symbolt &replace_const;
443444};
444445
445- bool constant_propagator_domaint::valuest::is_constant (const exprt &expr) const
446+ bool constant_propagator_domaint::valuest::is_constant (
447+ const exprt &expr,
448+ const namespacet &ns) const
446449{
447- return constant_propagator_is_constantt (replace_const)(expr);
450+ return constant_propagator_is_constantt (replace_const, ns )(expr);
448451}
449452
450- bool constant_propagator_domaint::valuest::is_constant (const irep_idt &id) const
453+ bool constant_propagator_domaint::valuest::is_constant (
454+ const irep_idt &id,
455+ const namespacet &ns) const
451456{
452- return constant_propagator_is_constantt (replace_const).is_constant (id);
457+ return constant_propagator_is_constantt (replace_const, ns ).is_constant (id);
453458}
454459
455460// / Do not call this when iterating over replace_const.expr_map!
@@ -657,7 +662,7 @@ bool constant_propagator_domaint::partial_evaluate(
657662 // if the current rounding mode is top we can
658663 // still get a non-top result by trying all rounding
659664 // modes and checking if the results are all the same
660- if (!known_values.is_constant (rounding_mode_identifier ()))
665+ if (!known_values.is_constant (rounding_mode_identifier (), ns ))
661666 return partial_evaluate_with_all_rounding_modes (known_values, expr, ns);
662667
663668 return replace_constants_and_simplify (known_values, expr, ns);
0 commit comments