summaryrefslogtreecommitdiff
path: root/core/gmp/538dfce27f41.patch
blob: 2e0a1af50a6c3c1e8064f40403fe76e24a19cca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

# HG changeset patch
# User Torbjorn Granlund <tege@gmplib.org>
# Date 1310730221 -7200
# Node ID 538dfce27f410b910d5e2f011119269e224d16a3
# Parent  03ed209dd7efd4f4fff0ce297bb3a8f7e7ba2366
(mpn_dcpi1_bdiv_q): Get mpn_sub_1 size argument right.

diff -r 03ed209dd7ef -r 538dfce27f41 mpn/generic/dcpi1_bdiv_q.c
--- a/mpn/generic/dcpi1_bdiv_q.c	Thu Jun 16 12:22:24 2011 +0200
+++ b/mpn/generic/dcpi1_bdiv_q.c	Fri Jul 15 13:43:41 2011 +0200
@@ -7,7 +7,7 @@
    SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES.  IN FACT, IT IS ALMOST
    GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
 
-Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+Copyright 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -28,7 +28,6 @@
 #include "gmp-impl.h"
 
 
-
 mp_size_t
 mpn_dcpi1_bdiv_q_n_itch (mp_size_t n)
 {
@@ -130,7 +129,7 @@
       qn = nn - qn;
       while (qn > dn)
 	{
-	  mpn_sub_1 (np + dn, np + dn, qn, cy);
+	  mpn_sub_1 (np + dn, np + dn, qn - dn, cy);
 	  cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp);
 	  qp += dn;
 	  np += dn;