diff --git a/src/ast/simplifiers/elim_unconstrained.cpp b/src/ast/simplifiers/elim_unconstrained.cpp index b3f833a785c..bb7a4fa49d8 100644 --- a/src/ast/simplifiers/elim_unconstrained.cpp +++ b/src/ast/simplifiers/elim_unconstrained.cpp @@ -205,7 +205,8 @@ void elim_unconstrained::freeze(expr* t) { if (!n.m_term) return; n.m_refcount = UINT_MAX / 2; - m_heap.increased(root(t)); + if (m_heap.contains(root(t))) + m_heap.increased(root(t)); } void elim_unconstrained::gc(expr* t) {