3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 03:45:51 +00:00

fix crashes due to my last commit

This commit is contained in:
Nuno Lopes 2020-07-12 19:53:22 +01:00
parent bb26f219fe
commit f30e8ccec3
3 changed files with 12 additions and 0 deletions

View file

@ -29,6 +29,7 @@ class mpq {
public:
mpq(int v):m_num(v), m_den(1) {}
mpq():m_den(1) {}
mpq(mpq &&) noexcept = default;
mpq & operator=(mpq const &) = delete;
void swap(mpq & other) { m_num.swap(other.m_num); m_den.swap(other.m_den); }
mpz const & numerator() const { return m_num; }

View file

@ -102,6 +102,15 @@ public:
mpz(int v):m_val(v), m_kind(mpz_small), m_owner(mpz_self), m_ptr(nullptr) {}
mpz():m_val(0), m_kind(mpz_small), m_owner(mpz_self), m_ptr(nullptr) {}
mpz(mpz_type* ptr): m_val(0), m_kind(mpz_small), m_owner(mpz_ext), m_ptr(ptr) { SASSERT(ptr);}
mpz(mpz && other) noexcept : m_val(other.m_val), m_kind(other.m_kind), m_owner(other.m_owner), m_ptr(nullptr) {
std::swap(m_ptr, other.m_ptr);
}
mpz& operator=(mpz &&other) {
swap(other);
return *this;
}
void swap(mpz & other) {
std::swap(m_val, other.m_val);
std::swap(m_ptr, other.m_ptr);