3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 03:07:07 +00:00

fix double ownership of enode marking causing crash during tracing. Issue #952

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-03-23 11:09:36 -07:00
parent e47e8c67c0
commit 1ab7ab9d74
3 changed files with 5 additions and 4 deletions

View file

@ -140,7 +140,7 @@ namespace z3 {
class context {
bool m_enable_exceptions;
Z3_context m_ctx;
static void error_handler(Z3_context /*c*/, Z3_error_code /*e*/) { /* do nothing */ }
static void error_handler(Z3_context c, Z3_error_code e) { std::cout << "ex\n"; Z3_THROW(exception(Z3_get_error_msg(c, e))); std::cout << "unreach\n"; }
void init(config & c) {
m_ctx = Z3_mk_context_rc(c);
m_enable_exceptions = true;

View file

@ -59,9 +59,9 @@ namespace smt {
SASSERT(n->trans_reaches(n->get_root()));
while (n) {
if (Set)
n->set_mark();
n->set_mark2();
else
n->unset_mark();
n->unset_mark2();
n = n->m_trans.m_target;
}
}
@ -84,7 +84,7 @@ namespace smt {
mark_enodes_in_trans<true>(n1);
while (true) {
SASSERT(n2);
if (n2->is_marked()) {
if (n2->is_marked2()) {
mark_enodes_in_trans<false>(n1);
return n2;
}

View file

@ -4214,6 +4214,7 @@ namespace smt {
for (unsigned i = 0; i < m_asserted_formulas.get_num_formulas(); ++i) {
expr* e = m_asserted_formulas.get_formula(i);
if (is_quantifier(e)) {
TRACE("context", tout << mk_pp(e, m) << "\n";);
quantifier* q = to_quantifier(e);
if (!m.is_rec_fun_def(q)) continue;
SASSERT(q->get_num_patterns() == 1);