diff options
author | Anatol Belski <ab@php.net> | 2015-03-17 21:08:26 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2015-03-17 22:11:31 +0100 |
commit | 0ac10750022d937e454aace5abd0e44b475d412c (patch) | |
tree | 0a5e811308fceab3d772fa0c3b696a583315023c /Zend/zend_strtod.c | |
parent | 9903767734e52fbe0f651827fa0693559eeadeef (diff) | |
download | php-git-0ac10750022d937e454aace5abd0e44b475d412c.tar.gz |
catching up with the git history
Diffstat (limited to 'Zend/zend_strtod.c')
-rw-r--r-- | Zend/zend_strtod.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index 0fadcef879..8348c69e91 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -619,6 +619,10 @@ Balloc x = 1 << k; #ifdef Omit_Private_Memory rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(ULong)); + if (!rv) { + FREE_DTOA_LOCK(0); + zend_error(E_ERROR, "Balloc() failed to allocate memory"); + } #else len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1) /sizeof(double); @@ -628,6 +632,10 @@ Balloc } else rv = (Bigint*)MALLOC(len*sizeof(double)); + if (!rv) { + FREE_DTOA_LOCK(0); + zend_error(E_ERROR, "Balloc() failed to allocate memory"); + } #endif rv->k = k; rv->maxwds = x; @@ -2553,7 +2561,7 @@ zend_strtod int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, e, e1; int esign, i, j, k, nd, nd0, nf, nz, nz0, nz1, sign; CONST char *s, *s0, *s1; - double aadj, aadj1; + volatile double aadj, aadj1; Long L; U aadj2, adj, rv, rv0; ULong y, z; @@ -3756,9 +3764,9 @@ zend_dtoa to hold the suppressed trailing zeros. */ - int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1, + int bbits, b2, b5, be, dig, i, ieps, ilim = 0, ilim0, ilim1, j, j1, k, k0, k_check, leftright, m2, m5, s2, s5, - spec_case, try_quick; + spec_case = 0, try_quick; Long L; #ifndef Sudden_Underflow int denorm; |