summaryrefslogtreecommitdiff
path: root/patches/mpfr/3.1.2/210-strtofr.patch
blob: 462162e6660e73e5750fb6d635e7dfd56086a0bc (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
39
40
41
42
43
44
45
46
47
48
49
diff -Naurd mpfr-3.1.2-a/PATCHES mpfr-3.1.2-b/PATCHES
--- mpfr-3.1.2-a/PATCHES	2014-12-04 01:41:57.131789485 +0000
+++ mpfr-3.1.2-b/PATCHES	2014-12-04 01:41:57.339791833 +0000
@@ -0,0 +1 @@
+strtofr
diff -Naurd mpfr-3.1.2-a/VERSION mpfr-3.1.2-b/VERSION
--- mpfr-3.1.2-a/VERSION	2014-12-04 01:41:57.127789443 +0000
+++ mpfr-3.1.2-b/VERSION	2014-12-04 01:41:57.339791833 +0000
@@ -1 +1 @@
-3.1.2-p10
+3.1.2-p11
diff -Naurd mpfr-3.1.2-a/src/mpfr.h mpfr-3.1.2-b/src/mpfr.h
--- mpfr-3.1.2-a/src/mpfr.h	2014-12-04 01:41:57.127789443 +0000
+++ mpfr-3.1.2-b/src/mpfr.h	2014-12-04 01:41:57.335791790 +0000
@@ -27,7 +27,7 @@
 #define MPFR_VERSION_MAJOR 3
 #define MPFR_VERSION_MINOR 1
 #define MPFR_VERSION_PATCHLEVEL 2
-#define MPFR_VERSION_STRING "3.1.2-p10"
+#define MPFR_VERSION_STRING "3.1.2-p11"
 
 /* Macros dealing with MPFR VERSION */
 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
diff -Naurd mpfr-3.1.2-a/src/strtofr.c mpfr-3.1.2-b/src/strtofr.c
--- mpfr-3.1.2-a/src/strtofr.c	2013-03-13 15:37:32.000000000 +0000
+++ mpfr-3.1.2-b/src/strtofr.c	2014-12-04 01:41:57.287791246 +0000
@@ -473,8 +473,10 @@
       /* prec bits corresponds to ysize limbs */
       ysize_bits = ysize * GMP_NUMB_BITS;
       /* and to ysize_bits >= prec > MPFR_PREC (x) bits */
-      y = MPFR_TMP_LIMBS_ALLOC (2 * ysize + 1);
-      y += ysize; /* y has (ysize+1) allocated limbs */
+      /* we need to allocate one more limb to work around bug
+         https://gmplib.org/list-archives/gmp-bugs/2013-December/003267.html */
+      y = MPFR_TMP_LIMBS_ALLOC (2 * ysize + 2);
+      y += ysize; /* y has (ysize+2) allocated limbs */
 
       /* pstr_size is the number of characters we read in pstr->mant
          to have at least ysize full limbs.
diff -Naurd mpfr-3.1.2-a/src/version.c mpfr-3.1.2-b/src/version.c
--- mpfr-3.1.2-a/src/version.c	2014-12-04 01:41:57.131789485 +0000
+++ mpfr-3.1.2-b/src/version.c	2014-12-04 01:41:57.339791833 +0000
@@ -25,5 +25,5 @@
 const char *
 mpfr_get_version (void)
 {
-  return "3.1.2-p10";
+  return "3.1.2-p11";
 }