summaryrefslogtreecommitdiff
path: root/mpz/cfdiv_r_2exp.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpz/cfdiv_r_2exp.c')
-rw-r--r--mpz/cfdiv_r_2exp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mpz/cfdiv_r_2exp.c b/mpz/cfdiv_r_2exp.c
index 094fe16fb..039198a97 100644
--- a/mpz/cfdiv_r_2exp.c
+++ b/mpz/cfdiv_r_2exp.c
@@ -50,6 +50,9 @@ cfdiv_r_2exp (mpz_ptr w, mpz_srcptr u, unsigned long cnt, int dir)
limb_cnt = cnt / BITS_PER_MP_LIMB;
cnt %= BITS_PER_MP_LIMB;
abs_usize = ABS (usize);
+
+ /* MPZ_REALLOC(w) below is only when w!=u, so we can fetch PTR(u) here
+ nice and early */
up = PTR(u);
if ((usize ^ dir) < 0)