3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-28 19:01:29 +00:00

Fix true positive critical bugs from static analysis discussion #8764

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-25 00:41:59 +00:00
parent 4a29c77aa2
commit ae4cb5557a
4 changed files with 9 additions and 3 deletions

View file

@ -164,7 +164,7 @@ extern "C" {
model::scoped_model_completion _scm(*_m, model_completion);
result = (*_m)(to_expr(t));
mk_c(c)->save_ast_trail(result.get());
*v = of_ast(result.get());
if (v) *v = of_ast(result.get());
RETURN_Z3_model_eval true;
Z3_CATCH_RETURN(false);
}

View file

@ -531,6 +531,8 @@ namespace mbp {
}
arr_vars.shrink(j);
aux_vars.append (m_aux_vars);
m_mev = nullptr;
M = nullptr;
}
};

View file

@ -834,7 +834,7 @@ namespace pb {
}
void solver::ineq::divide(unsigned c) {
if (c == 1) return;
if (c <= 1) return;
for (unsigned i = size(); i-- > 0; ) {
m_wlits[i].first = (coeff(i) + c - 1) / c;
}
@ -857,7 +857,7 @@ namespace pb {
*/
void solver::round_to_one(ineq& ineq, bool_var v) {
unsigned c = ineq.bv_coeff(v);
if (c == 1) return;
if (c <= 1) return;
unsigned sz = ineq.size();
for (unsigned i = 0; i < sz; ++i) {
unsigned ci = ineq.coeff(i);

View file

@ -187,11 +187,15 @@ public:
}
checked_int64& operator/=(checked_int64 const& other) {
if (CHECK && other.m_value == 0)
throw overflow_exception();
m_value /= other.m_value;
return *this;
}
checked_int64& operator%=(checked_int64 const& other) {
if (CHECK && other.m_value == 0)
throw overflow_exception();
m_value %= other.m_value;
return *this;
}