3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 12:08:18 +00:00
deal with memory leak when there is an exception
This commit is contained in:
Nikolaj Bjorner 2023-10-15 12:15:28 -07:00
parent 5942dc24bd
commit 41b1f47d77
2 changed files with 3 additions and 3 deletions

View file

@ -576,14 +576,13 @@ namespace q {
void ematch::add(quantifier* _q) { void ematch::add(quantifier* _q) {
TRACE("q", tout << "add " << mk_pp(_q, m) << "\n"); TRACE("q", tout << "add " << mk_pp(_q, m) << "\n");
clause* c = clausify(_q); scoped_ptr<clause> c = clausify(_q);
quantifier* q = c->q(); quantifier* q = c->q();
if (m_q2clauses.contains(q)) { if (m_q2clauses.contains(q)) {
dealloc(c);
return; return;
} }
ensure_ground_enodes(*c); ensure_ground_enodes(*c);
m_clauses.push_back(c); m_clauses.push_back(c.detach());
m_q2clauses.insert(q, c->index()); m_q2clauses.insert(q, c->index());
ctx.push(pop_clause(*this)); ctx.push(pop_clause(*this));
init_watch(*c); init_watch(*c);

View file

@ -1648,6 +1648,7 @@ public:
break; break;
} }
switch (check_nla()) { switch (check_nla()) {
case FC_DONE: case FC_DONE:
break; break;