summaryrefslogtreecommitdiff
path: root/patches/gmp/5.1.1/110-mpz_powm_ui.patch
diff options
context:
space:
mode:
authorKirill K. Smirnov <kirill.k.smirnov@gmail.com>2016-09-17 21:57:43 (GMT)
committerKirill K. Smirnov <kirill.k.smirnov@gmail.com>2016-09-17 21:57:43 (GMT)
commitbcb6b03df97fcb96867771fbb24491b4a03449b5 (patch)
treea01d0a482db3107db8fa16f52f4c872c29005fc5 /patches/gmp/5.1.1/110-mpz_powm_ui.patch
parent5a88b7fd2a0c24f65cf64e3d3050b0b5bdcd4e53 (diff)
patches: add patches for gmp
This changeset adds official patches published on gmp website. Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
Diffstat (limited to 'patches/gmp/5.1.1/110-mpz_powm_ui.patch')
-rw-r--r--patches/gmp/5.1.1/110-mpz_powm_ui.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/patches/gmp/5.1.1/110-mpz_powm_ui.patch b/patches/gmp/5.1.1/110-mpz_powm_ui.patch
new file mode 100644
index 0000000..f0d240c
--- /dev/null
+++ b/patches/gmp/5.1.1/110-mpz_powm_ui.patch
@@ -0,0 +1,39 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1363174284 -3600
+# Node ID ec4d88674036804b26f22c6a2bfca6ae1e92d370
+# Parent e616ff715c34e112d0a5f7535d31ffe1194a5c7d
+(mod): Adhere to mpn_mu_div_qr's overlap requirements.
+
+diff -r e616ff715c34 -r ec4d88674036 mpz/powm_ui.c
+--- a/mpz/powm_ui.c Sun Feb 17 19:40:16 2013 +0100
++++ b/mpz/powm_ui.c Wed Mar 13 12:31:24 2013 +0100
+@@ -2,8 +2,8 @@
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+-Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2005, 2008,
+-2009, 2011, 2012 Free Software Foundation, Inc.
++Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2005, 2008, 2009,
++2011, 2012, 2013 Free Software Foundation, Inc.
+
+ This file is part of the GNU MP Library.
+
+@@ -70,9 +70,14 @@
+ }
+ else
+ {
++ /* We need to allocate separate remainder area, since mpn_mu_div_qr does
++ not handle overlap between the numerator and remainder areas.
++ FIXME: Make it handle such overlap. */
++ mp_ptr rp = TMP_ALLOC_LIMBS (dn);
+ mp_size_t itch = mpn_mu_div_qr_itch (nn, dn, 0);
+ mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
+- mpn_mu_div_qr (qp, np, np, nn, dp, dn, scratch);
++ mpn_mu_div_qr (qp, rp, np, nn, dp, dn, scratch);
++ MPN_COPY (np, rp, dn);
+ }
+
+ TMP_FREE;
+