Skip to content

Commit de43e05

Browse files
fix overflow bug exposed by #2476
Signed-off-by: Nikolaj Bjorner <[email protected]>
1 parent a8bfab3 commit de43e05

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/smt/theory_pb.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,6 +1597,9 @@ namespace smt {
15971597
value += coeff;
15981598
}
15991599
}
1600+
if (value >= 0) {
1601+
display_resolved_lemma(verbose_stream() << "not validated\n");
1602+
}
16001603
// std::cout << "bound: " << m_bound << " value " << value << " coeffs: " << m_active_vars.size() << " lemma is " << (value >= 0 ? "sat" : "unsat") << "\n";
16011604
return value < 0;
16021605
}
@@ -1804,8 +1807,8 @@ namespace smt {
18041807
}
18051808
if (g >= 2) {
18061809
normalize_active_coeffs();
1807-
for (unsigned i = 0; i < m_active_vars.size(); ++i) {
1808-
m_coeffs[m_active_vars[i]] /= g;
1810+
for (auto v : m_active_vars) {
1811+
m_coeffs[v] /= static_cast<int>(g);
18091812
}
18101813
m_bound = (m_bound + g - 1) / g;
18111814
TRACE("pb", display_resolved_lemma(tout << "cut\n"););

0 commit comments

Comments
 (0)