diff --git a/src/util/mpz.h b/src/util/mpz.h index 136066e6eb..ff9a3f3306 100644 --- a/src/util/mpz.h +++ b/src/util/mpz.h @@ -593,7 +593,7 @@ public: void bitwise_not(unsigned sz, mpz const & a, mpz & c); void set(mpz & target, mpz const & source) { - if (&target == &source) { + if (&target == &source || (target.has_ptr() && source.has_ptr() && target.ptr() == source.ptr())) { return; } if (is_small(source)) {