3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 00:55:31 +00:00

scoping th solver to avoid memory leak during cancellation exposed by #3431

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-03-22 14:14:45 -07:00
parent d1f6470805
commit 70a1786061
5 changed files with 10 additions and 6 deletions

View file

@ -2152,12 +2152,12 @@ namespace qe {
expr_ref fml0(fml, m);
quant_elim_plugin* th;
scoped_ptr<quant_elim_plugin> th;
pop_context(th);
th->check(num_vars, vars, m_assumption, fml, get_first, free_vars, defs);
push_context(th);
push_context(th.detach());
TRACE("qe",
for (unsigned i = 0; i < num_vars; ++i) {
tout << mk_ismt2_pp(vars[i], m) << " ";
@ -2175,7 +2175,7 @@ namespace qe {
return l_undef;
}
void pop_context(quant_elim_plugin*& th) {
void pop_context(scoped_ptr<quant_elim_plugin>& th) {
if (m_plugins.empty()) {
th = alloc(quant_elim_plugin, m, *this, m_fparams);
th->add_plugin(mk_bool_plugin(*th));