Skip to content

Commit e67a2b9

Browse files
committed
Fixed bug #64142 (dval to lval different behavior on ppc64)
See discussion on internals http://marc.info/?t=136042277700003&r=1&w=2
1 parent bfdb889 commit e67a2b9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2012, PHP 5.4.13
44

5+
- Core:
6+
. Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi)
7+
58
- CLI server:
69
. Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi)
710

Zend/zend_operators.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ static zend_always_inline long zend_dval_to_lval(double d)
7979
#else
8080
static zend_always_inline long zend_dval_to_lval(double d)
8181
{
82-
if (d > LONG_MAX) {
82+
/* >= as (double)LONG_MAX is outside signed range */
83+
if (d >= LONG_MAX) {
8384
return (long)(unsigned long) d;
8485
}
8586
return (long) d;

0 commit comments

Comments
 (0)