mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
fix model return after shutdown, reported in #4532
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
b71a64365d
commit
8857a67e4f
|
@ -4486,7 +4486,11 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::get_model(model_ref & mdl) {
|
void context::get_model(model_ref & mdl) {
|
||||||
if (inconsistent() || !m.inc())
|
if (inconsistent())
|
||||||
|
mdl = nullptr;
|
||||||
|
else if (m_model.get())
|
||||||
|
mdl = m_model.get();
|
||||||
|
else if (!m.inc())
|
||||||
mdl = nullptr;
|
mdl = nullptr;
|
||||||
else {
|
else {
|
||||||
mk_proto_model();
|
mk_proto_model();
|
||||||
|
|
|
@ -163,6 +163,7 @@ namespace smt {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool first = false;
|
bool first = false;
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(mux);
|
std::lock_guard<std::mutex> lock(mux);
|
||||||
|
|
|
@ -433,6 +433,9 @@ private:
|
||||||
}
|
}
|
||||||
m_models.push_back(mdl.get());
|
m_models.push_back(mdl.get());
|
||||||
}
|
}
|
||||||
|
else if (m_models.empty()) {
|
||||||
|
m_has_undef = true;
|
||||||
|
}
|
||||||
if (!m_allsat) {
|
if (!m_allsat) {
|
||||||
m_queue.shutdown();
|
m_queue.shutdown();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue