summaryrefslogtreecommitdiff
path: root/mpz/powm.c
diff options
context:
space:
mode:
authortege <tege@gmplib.org>2001-11-18 02:32:54 +0100
committertege <tege@gmplib.org>2001-11-18 02:32:54 +0100
commit9d898f9cea710cbd98bd56a9dd5ed36511fa177b (patch)
treeb2a2da9c7077a7ba46cc3e296f433e48e4aa9630 /mpz/powm.c
parentc5c680cc356bcf3331072799fd28c948c4567cd2 (diff)
downloadgmp-9d898f9cea710cbd98bd56a9dd5ed36511fa177b.tar.gz
Move TMP_MARK to before any TMP_ALLOCs.
Diffstat (limited to 'mpz/powm.c')
-rw-r--r--mpz/powm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mpz/powm.c b/mpz/powm.c
index 8b055cda4..7943099e6 100644
--- a/mpz/powm.c
+++ b/mpz/powm.c
@@ -176,6 +176,8 @@ pow (mpz_srcptr b, mpz_srcptr e, mpz_srcptr m, mpz_ptr r)
if (mn == 0)
DIVIDE_BY_ZERO;
+ TMP_MARK (marker);
+
es = SIZ (e);
if (es <= 0)
{
@@ -185,6 +187,7 @@ pow (mpz_srcptr b, mpz_srcptr e, mpz_srcptr m, mpz_ptr r)
m equals 1. */
SIZ(r) = (mn == 1 && mp[0] == 1) ? 0 : 1;
PTR(r)[0] = 1;
+ TMP_FREE (marker); /* we haven't really allocated anything here */
return;
}
#if HANDLE_NEGATIVE_EXPONENT
@@ -210,8 +213,6 @@ pow (mpz_srcptr b, mpz_srcptr e, mpz_srcptr m, mpz_ptr r)
}
#endif
- TMP_MARK (marker);
-
use_redc = mn < POWM_THRESHOLD && mp[0] % 2 != 0;
if (use_redc)
{