From d3aa5682b1e13dd33a2a96fc0313778fbcdb764c Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Sun, 27 Jul 2008 11:28:53 +0000 Subject: [PATCH] Fix for bug #43487 (Wrong conversion of float to string) --- Zend/zend_strtod.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index bf0c70d7df..cb5ef58ba1 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -984,9 +984,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; @@ -1026,7 +1026,7 @@ b2d { ULong *xa, *xa0, w, y, z; int k; - _double d; + volatile _double d; #ifdef VAX ULong d0, d1; #else @@ -1092,7 +1092,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 @@ -1213,7 +1213,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); @@ -1480,7 +1480,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; @@ -2043,7 +2043,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; -- 2.50.1