mirror of
https://github.com/Z3Prover/z3
synced 2026-02-19 23:14:40 +00:00
Revert deallocation in set methods and restore indentation in gcd function
Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
This commit is contained in:
parent
cd492c3e9c
commit
d3572a95b9
2 changed files with 228 additions and 238 deletions
|
|
@ -338,10 +338,7 @@ class mpz_manager {
|
|||
void set_big_i64(mpz & c, int64_t v);
|
||||
|
||||
void set_i64(mpz & c, int64_t v) {
|
||||
if (mpz::fits_in_small(v)) {
|
||||
if (!is_small(c)) {
|
||||
deallocate(c);
|
||||
}
|
||||
if (mpz::fits_in_small(v) && is_small(c)) {
|
||||
c.set64(v);
|
||||
}
|
||||
else {
|
||||
|
|
@ -663,10 +660,7 @@ public:
|
|||
|
||||
void set(mpz & a, int val) {
|
||||
// On 32-bit platforms, int can be outside small range
|
||||
if (mpz::fits_in_small(val)) {
|
||||
if (!is_small(a)) {
|
||||
deallocate(a);
|
||||
}
|
||||
if (mpz::fits_in_small(val) && is_small(a)) {
|
||||
a.set(val);
|
||||
}
|
||||
else {
|
||||
|
|
@ -675,10 +669,7 @@ public:
|
|||
}
|
||||
|
||||
void set(mpz & a, unsigned val) {
|
||||
if (mpz::fits_in_small(val)) {
|
||||
if (!is_small(a)) {
|
||||
deallocate(a);
|
||||
}
|
||||
if (mpz::fits_in_small(val) && is_small(a)) {
|
||||
a.set(static_cast<int>(val));
|
||||
}
|
||||
else {
|
||||
|
|
@ -693,10 +684,7 @@ public:
|
|||
}
|
||||
|
||||
void set(mpz & a, uint64_t val) {
|
||||
if (mpz::fits_in_small(val)) {
|
||||
if (!is_small(a)) {
|
||||
deallocate(a);
|
||||
}
|
||||
if (mpz::fits_in_small(val) && is_small(a)) {
|
||||
a.set64(static_cast<int64_t>(val));
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue