|
@@ -0,0 +1,91 @@
|
|
1
|
+--- classpath-0.99.orig/native/fdlibm/dtoa.c 2007-09-27 05:33:38.000000000 -0700
|
|
2
|
++++ classpath-0.99/native/fdlibm/dtoa.c 2014-12-21 14:22:42.451713851 -0800
|
|
3
|
+@@ -883,6 +883,16 @@ ret1:
|
|
4
|
+ return s0;
|
|
5
|
+ }
|
|
6
|
+
|
|
7
|
++void free_Bigints(struct _Jv_Bigint *p)
|
|
8
|
++{
|
|
9
|
++ struct _Jv_Bigint *l = p;
|
|
10
|
++ while (l)
|
|
11
|
++ {
|
|
12
|
++ struct _Jv_Bigint *next = l->_next;
|
|
13
|
++ free (l);
|
|
14
|
++ l = next;
|
|
15
|
++ }
|
|
16
|
++}
|
|
17
|
+
|
|
18
|
+ _VOID
|
|
19
|
+ _DEFUN (_dtoa,
|
|
20
|
+@@ -905,16 +915,15 @@ _DEFUN (_dtoa,
|
|
21
|
+ p = _dtoa_r (&reent, _d, mode, ndigits, decpt, sign, rve, float_type);
|
|
22
|
+ strcpy (buf, p);
|
|
23
|
+
|
|
24
|
+- for (i = 0; i < reent._result_k; ++i)
|
|
25
|
++ for (i = 0; i < reent._max_k; ++i)
|
|
26
|
+ {
|
|
27
|
+- struct _Jv_Bigint *l = reent._freelist[i];
|
|
28
|
+- while (l)
|
|
29
|
+- {
|
|
30
|
+- struct _Jv_Bigint *next = l->_next;
|
|
31
|
+- free (l);
|
|
32
|
+- l = next;
|
|
33
|
+- }
|
|
34
|
++ free_Bigints(reent._freelist[i]);
|
|
35
|
+ }
|
|
36
|
+ if (reent._freelist)
|
|
37
|
+ free (reent._freelist);
|
|
38
|
++
|
|
39
|
++ if (reent._result)
|
|
40
|
++ free(reent._result);
|
|
41
|
++
|
|
42
|
++ free_Bigints(reent._p5s);
|
|
43
|
+ }
|
|
44
|
+--- classpath-0.99.orig/native/jni/java-lang/java_lang_VMDouble.c 2008-02-08 09:42:57.000000000 -0800
|
|
45
|
++++ classpath-0.99/native/jni/java-lang/java_lang_VMDouble.c 2014-12-21 14:35:50.733800626 -0800
|
|
46
|
+@@ -158,6 +158,17 @@ Java_java_lang_VMDouble_longBitsToDouble
|
|
47
|
+ return val.d;
|
|
48
|
+ }
|
|
49
|
+
|
|
50
|
++static void free_Bigints(struct _Jv_Bigint *p)
|
|
51
|
++{
|
|
52
|
++ struct _Jv_Bigint *l = p;
|
|
53
|
++ while (l)
|
|
54
|
++ {
|
|
55
|
++ struct _Jv_Bigint *next = l->_next;
|
|
56
|
++ free (l);
|
|
57
|
++ l = next;
|
|
58
|
++ }
|
|
59
|
++}
|
|
60
|
++
|
|
61
|
+ /**
|
|
62
|
+ * Parse a double from a char array.
|
|
63
|
+ */
|
|
64
|
+@@ -167,7 +178,7 @@ parseDoubleFromChars(JNIEnv * env, const
|
|
65
|
+ char *endptr;
|
|
66
|
+ jdouble val = 0.0;
|
|
67
|
+ const char *p = buf, *end, *last_non_ws, *temp;
|
|
68
|
+- int ok = 1;
|
|
69
|
++ int i, ok = 1;
|
|
70
|
+
|
|
71
|
+ #ifdef DEBUG
|
|
72
|
+ fprintf (stderr, "java.lang.VMDouble.parseDouble (%s)\n", buf);
|
|
73
|
+@@ -224,6 +235,18 @@ parseDoubleFromChars(JNIEnv * env, const
|
|
74
|
+
|
|
75
|
+ val = _strtod_r (&reent, p, &endptr);
|
|
76
|
+
|
|
77
|
++ for (i = 0; i < reent._max_k; ++i)
|
|
78
|
++ {
|
|
79
|
++ free_Bigints(reent._freelist[i]);
|
|
80
|
++ }
|
|
81
|
++ if (reent._freelist)
|
|
82
|
++ free (reent._freelist);
|
|
83
|
++
|
|
84
|
++ if (reent._result)
|
|
85
|
++ free (reent._result);
|
|
86
|
++
|
|
87
|
++ free_Bigints(reent._p5s);
|
|
88
|
++
|
|
89
|
+ #ifdef DEBUG
|
|
90
|
+ fprintf (stderr, "java.lang.VMDouble.parseDouble val = %g\n", val);
|
|
91
|
+ fprintf (stderr, "java.lang.VMDouble.parseDouble %p != %p ???\n",
|