From 4c8c511b409295305c4722ed93f727c39e918a36 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 05:16:21 +0000 Subject: [PATCH] Document MSVC ARM64 magnitude extraction --- src/util/mpz.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/mpz.cpp b/src/util/mpz.cpp index 00fecdc59c..026b88732f 100644 --- a/src/util/mpz.cpp +++ b/src/util/mpz.cpp @@ -38,6 +38,7 @@ static bool mul_overflows(int64_t a, int64_t b, int64_t & result) { // Overflow if high bits are not the sign extension of result return high != (result >> 63); #elif defined(_MSC_VER) + // Extract magnitudes without ever evaluating -INT64_MIN. uint64_t x = a < 0 ? static_cast(-(a + 1)) + 1 : static_cast(a); uint64_t y = b < 0 ? static_cast(-(b + 1)) + 1 : static_cast(b); bool is_neg = (a < 0) != (b < 0);