diff options
author | tege <tege@gmplib.org> | 2001-11-18 02:32:54 +0100 |
---|---|---|
committer | tege <tege@gmplib.org> | 2001-11-18 02:32:54 +0100 |
commit | 9d898f9cea710cbd98bd56a9dd5ed36511fa177b (patch) | |
tree | b2a2da9c7077a7ba46cc3e296f433e48e4aa9630 /mpz/powm.c | |
parent | c5c680cc356bcf3331072799fd28c948c4567cd2 (diff) | |
download | gmp-9d898f9cea710cbd98bd56a9dd5ed36511fa177b.tar.gz |
Move TMP_MARK to before any TMP_ALLOCs.
Diffstat (limited to 'mpz/powm.c')
-rw-r--r-- | mpz/powm.c | 5 |
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) { |