From bba87df6dffd54857905de230559cc76d2ce73a1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 10:40:59 +0000 Subject: [PATCH] Fix uninitialized and array-bounds build warnings Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/ee8157b2-c614-4b32-b54b-ecfa0afcbf9f Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- src/ast/simplifiers/bound_propagator.cpp | 3 +-- src/util/mpz.h | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ast/simplifiers/bound_propagator.cpp b/src/ast/simplifiers/bound_propagator.cpp index 240ba7a98..a73d81fb8 100644 --- a/src/ast/simplifiers/bound_propagator.cpp +++ b/src/ast/simplifiers/bound_propagator.cpp @@ -381,7 +381,7 @@ bool bound_propagator::relevant_bound(var x, double new_k) const { if (b == nullptr) return true; // variable did not have a bound - double interval_size; + double interval_size = 0.0; bool bounded = get_interval_size(x, interval_size); if (!is_int(x)) { @@ -939,4 +939,3 @@ void bound_propagator::display(std::ostream & out) const { } - diff --git a/src/util/mpz.h b/src/util/mpz.h index 505bb177e..7b714b9be 100644 --- a/src/util/mpz.h +++ b/src/util/mpz.h @@ -314,13 +314,14 @@ class mpz_manager { else { cell = reserve; cell->m_size = 1; + digit_t* cell_digits = reinterpret_cast(cell + 1); if (a.value() < 0) { sign = -1; - cell->m_digits[0] = -a.value(); + cell_digits[0] = -a.value(); } else { sign = 1; - cell->m_digits[0] = a.value(); + cell_digits[0] = a.value(); } } }