mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
fix assertion violation in the code path where the simplifier throws a memout exception
This commit is contained in:
parent
31d4ba0009
commit
076d3dbf13
|
@ -45,6 +45,7 @@ namespace sat {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool integrity_checker::check_clause(clause const & c) const {
|
bool integrity_checker::check_clause(clause const & c) const {
|
||||||
|
CTRACE("sat_bug", c.was_removed(), s.display(tout << "c: " << c.id() << ": " << c << "\n"));
|
||||||
SASSERT(!c.was_removed());
|
SASSERT(!c.was_removed());
|
||||||
for (unsigned i = 0; i < c.size(); i++) {
|
for (unsigned i = 0; i < c.size(); i++) {
|
||||||
VERIFY(c[i].var() <= s.num_vars());
|
VERIFY(c[i].var() <= s.num_vars());
|
||||||
|
|
|
@ -247,6 +247,8 @@ namespace sat {
|
||||||
|
|
||||||
bool is_marked(literal l) const { return m_visited[l.index()] != 0; }
|
bool is_marked(literal l) const { return m_visited[l.index()] != 0; }
|
||||||
|
|
||||||
|
bool need_cleanup() const { return m_need_cleanup; }
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace sat {
|
||||||
|
|
||||||
solver::~solver() {
|
solver::~solver() {
|
||||||
m_ext = nullptr;
|
m_ext = nullptr;
|
||||||
SASSERT(m_config.m_num_threads > 1 || m_trim || check_invariant());
|
SASSERT(m_config.m_num_threads > 1 || m_trim || rlimit().is_canceled() || check_invariant());
|
||||||
CTRACE("sat", !m_clauses.empty(), tout << "Delete clauses\n";);
|
CTRACE("sat", !m_clauses.empty(), tout << "Delete clauses\n";);
|
||||||
del_clauses(m_clauses);
|
del_clauses(m_clauses);
|
||||||
CTRACE("sat", !m_learned.empty(), tout << "Delete learned\n";);
|
CTRACE("sat", !m_learned.empty(), tout << "Delete learned\n";);
|
||||||
|
@ -3872,6 +3872,8 @@ namespace sat {
|
||||||
// -----------------------
|
// -----------------------
|
||||||
bool solver::check_invariant() const {
|
bool solver::check_invariant() const {
|
||||||
if (!m_rlimit.inc()) return true;
|
if (!m_rlimit.inc()) return true;
|
||||||
|
if (m_simplifier.need_cleanup())
|
||||||
|
return true;
|
||||||
integrity_checker checker(*this);
|
integrity_checker checker(*this);
|
||||||
VERIFY(checker());
|
VERIFY(checker());
|
||||||
VERIFY(!m_ext || m_ext->validate());
|
VERIFY(!m_ext || m_ext->validate());
|
||||||
|
|
Loading…
Reference in a new issue