From 96128e5b6b42a23f8dbb9e586791d534fae5f340 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 05:53:35 +0000 Subject: [PATCH] Fix mpz self-assignment in set --- src/util/mpz.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/mpz.h b/src/util/mpz.h index f572406a4e..136066e6eb 100644 --- a/src/util/mpz.h +++ b/src/util/mpz.h @@ -593,6 +593,9 @@ public: void bitwise_not(unsigned sz, mpz const & a, mpz & c); void set(mpz & target, mpz const & source) { + if (&target == &source) { + return; + } if (is_small(source)) { set(target, source.value()); }