3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00
deal with memory leak on exceptions
This commit is contained in:
Nikolaj Bjorner 2023-10-15 12:17:08 -07:00
parent 41b1f47d77
commit b2efa592ce

View file

@ -486,7 +486,7 @@ namespace q {
* basic clausifier, assumes q has been normalized. * basic clausifier, assumes q has been normalized.
*/ */
clause* ematch::clausify(quantifier* _q) { clause* ematch::clausify(quantifier* _q) {
clause* cl = alloc(clause, m, m_clauses.size()); scoped_ptr<clause> cl = alloc(clause, m, m_clauses.size());
cl->m_literal = ctx.mk_literal(_q); cl->m_literal = ctx.mk_literal(_q);
quantifier_ref q(_q, m); quantifier_ref q(_q, m);
q = m_qs.flatten(q); q = m_qs.flatten(q);
@ -514,7 +514,7 @@ namespace q {
unsigned generation = nq ? nq->generation() : ctx.generation(); unsigned generation = nq ? nq->generation() : ctx.generation();
cl->m_stat = m_qstat_gen(_q, generation); cl->m_stat = m_qstat_gen(_q, generation);
SASSERT(ctx.s().value(cl->m_literal) == l_true); SASSERT(ctx.s().value(cl->m_literal) == l_true);
return cl; return cl.detach();
} }
lit ematch::clausify_literal(expr* arg) { lit ematch::clausify_literal(expr* arg) {