Skip to content

Commit

Permalink
fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed May 1, 2024
1 parent 1ef4354 commit 869643a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/nlsat/nlsat_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3033,7 +3033,7 @@ namespace nlsat {
var x, ptr_vector<clause>& clauses,
vector<bound_constraint>& lo, vector<bound_constraint>& hi) {

polynomial_ref C(m_pm);
polynomial_ref C(m_pm), D(m_pm);
for (auto c : clauses)
c->set_removed();

Expand All @@ -3043,7 +3043,8 @@ namespace nlsat {
// h.A * x + h.B, h.is_strict; h.A > 0
// (l.A x + l.B)*h.A + (h.A x + h.B)*|l.A| >= 0
C = m_pm.mul(l.B, h.A);
C = m_pm.sub(C, m_pm.mul(h.B, l.A));
D = m_pm.mul(h.B, l.A);
C = m_pm.sub(C, D);
poly* p = C.get();
bool is_even = false;
m_lemma.reset();
Expand Down Expand Up @@ -3101,6 +3102,7 @@ namespace nlsat {
auto a1 = static_cast<_assumption_set>(l.c->assumptions());
auto a2 = static_cast<_assumption_set>(h.c->assumptions());
a1 = m_asm.mk_join(a1, a2);
m_lemma_assumptions = a1;

// TODO: this can also replace solve_eqs
for (auto c : clauses) {
Expand Down

0 comments on commit 869643a

Please sign in to comment.