]> granicus.if.org Git - php/commitdiff
Fix for bug #43487 (Wrong conversion of float to string)
authorDmitry Stogov <dmitry@php.net>
Sun, 27 Jul 2008 11:29:59 +0000 (11:29 +0000)
committerDmitry Stogov <dmitry@php.net>
Sun, 27 Jul 2008 11:29:59 +0000 (11:29 +0000)
Zend/zend_strtod.c

index 7f06b0e9ec71a62b66b5177be6c45700c4e8e539..d42350c66ffaa24499e99c986b20df7a2b08001a 100644 (file)
@@ -991,9 +991,9 @@ static Bigint * diff(Bigint *a, Bigint *b) /* {{{ */
 
 static double ulp (double _x) /* {{{ */
 {
-       _double x;
+       volatile _double x;
        register Long L;
-       _double a;
+       volatile _double a;
 
        value(x) = _x;
        L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
@@ -1035,7 +1035,7 @@ b2d
 {
        ULong *xa, *xa0, w, y, z;
        int k;
-       _double d;
+       volatile _double d;
 #ifdef VAX
        ULong d0, d1;
 #else
@@ -1101,7 +1101,7 @@ static Bigint * d2b(double _d, int *e, int *bits) /* {{{ */
        Bigint *b;
        int de, i, k;
        ULong *x, y, z;
-       _double d;
+       volatile _double d;
 #ifdef VAX
        ULong d0, d1;
 #endif
@@ -1223,7 +1223,7 @@ static Bigint * d2b(double _d, int *e, int *bits) /* {{{ */
 
 static double ratio (Bigint *a, Bigint *b) /* {{{ */
 {
-       _double da, db;
+       volatile _double da, db;
        int k, ka, kb;
 
        value(da) = b2d(a, &ka);
@@ -1492,7 +1492,7 @@ ZEND_API char * zend_dtoa(double _d, int mode, int ndigits, int *decpt, int *sig
        Bigint *b, *b1, *delta, *mlo, *mhi, *S, *tmp;
        double ds;
        char *s, *s0;
-       _double d, d2, eps;
+       volatile _double d, d2, eps;
 
        value(d) = _d;
 
@@ -2056,7 +2056,7 @@ ZEND_API double zend_strtod (CONST char *s00, char **se) /* {{{ */
                e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
        CONST char *s, *s0, *s1;
        double aadj, aadj1, adj;
-       _double rv, rv0;
+       volatile _double rv, rv0;
        Long L;
        ULong y, z;
        Bigint *bb, *bb1, *bd, *bd0, *bs, *delta, *tmp;