Timm Friebe wrote:
+ case 3:
+ /* This signals we have an integer datatype, but we need to convert to double if we + * overflow. */
convert_to_double(&result->data[i][j]);
+ if (Z_DVAL(result->data[i][j]) >= LONG_MIN && Z_DVAL(result->data[i][j]) <= LONG_MAX) {
+ convert_to_long(&result->data[i][j]);
+ }
break;

Hi Timm,

I think this code is broken on 64-bit archs, as doubles lack the precision to accurately represent a 64-bit long. Also, comparing double values with LONG_[MIN|MAX] is dangerous for the same reason.


-- regards,

Ard

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to