From 1ab7ab9d744d5cddec94ae539d4d52233fedcb16 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Thu, 23 Mar 2017 11:09:36 -0700 Subject: [PATCH] fix double ownership of enode marking causing crash during tracing. Issue #952 Signed-off-by: Nikolaj Bjorner --- src/api/c++/z3++.h | 2 +- src/smt/smt_conflict_resolution.cpp | 6 +++--- src/smt/smt_context.cpp | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/api/c++/z3++.h b/src/api/c++/z3++.h index b6157f3ff..104f3ae6c 100644 --- a/src/api/c++/z3++.h +++ b/src/api/c++/z3++.h @@ -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; diff --git a/src/smt/smt_conflict_resolution.cpp b/src/smt/smt_conflict_resolution.cpp index 7dd9144fe..8d90f9583 100644 --- a/src/smt/smt_conflict_resolution.cpp +++ b/src/smt/smt_conflict_resolution.cpp @@ -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(n1); while (true) { SASSERT(n2); - if (n2->is_marked()) { + if (n2->is_marked2()) { mark_enodes_in_trans(n1); return n2; } diff --git a/src/smt/smt_context.cpp b/src/smt/smt_context.cpp index 9336322f7..6bc5cc6ab 100644 --- a/src/smt/smt_context.cpp +++ b/src/smt/smt_context.cpp @@ -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);