com php-src: Fixed bug #64142 (dval to lval different behavior on ppc64): NEWS Zend/zend_operators.h
| From: | Remi Collet | Date: | Mon, 04 Feb 2013 14:19:32 +0000 |
| Subject: | com php-src: Fixed bug #64142 (dval to lval different behavior on ppc64): NEWS Zend/zend_operators.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71164@lists.php.net to get a copy of this message | ||
Commit: 6533094d9e4d0c85044a170d9fad9a3986a68675
Author: Remi Collet <remi@php.net> Mon, 4 Feb 2013 15:19:32 +0100
Parents: 740b823be80a29e4c6537d4053eb7bad0fae6c41
Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6533094d9e4d0c85044a170d9fad9a3986a68675
Log:
Fixed bug #64142 (dval to lval different behavior on ppc64)
On x86_64:
(long)(double)9223372036854775807+1 = -9223372036854775808
On ppc64
(long)(double)9223372036854775807-1 = 9223372036854775807
Bugs:
https://bugs.php.net/64142
Changed paths:
M NEWS
M Zend/zend_operators.h
Diff:
diff --git a/NEWS b/NEWS
index 2aff180..0649d9d 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ PHP NEWS
- CLI server:
. Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi)
+- Core:
+ . Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi)
+
?? ??? 2012, PHP 5.4.12
- Core:
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 02a96dd..93b904f 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -79,7 +79,7 @@ static zend_always_inline long zend_dval_to_lval(double d)
#else
static zend_always_inline long zend_dval_to_lval(double d)
{
- if (d > LONG_MAX) {
+ if (d >= LONG_MAX) {
return (long)(unsigned long) d;
}
return (long) d;