com php-src: Merge branch 'PHP-5.6' into PHP-7.0: ext/standard/math.c

From: Date: Wed, 23 Dec 2015 17:24:56 +0000
Subject: com php-src: Merge branch 'PHP-5.6' into PHP-7.0: ext/standard/math.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-90425@lists.php.net to get a copy of this message
Commit: d97b161f10a42a6c6f389b3962f33f990b20dcdc Author: Anatol Belski <ab@php.net> Wed, 23 Dec 2015 18:24:56 +0100 Parents: 5c11f4c489eec23d88950b7c25f904d899231857 50c4be0309a63c51b00b97566493aa401d0f7562 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d97b161f10a42a6c6f389b3962f33f990b20dcdc Log: Merge branch 'PHP-5.6' into PHP-7.0 * PHP-5.6: Added test for bug #71201 Bug #71201 round() segfault on 64-bit builds Bugs: https://bugs.php.net/71201 Changed paths: MM ext/standard/math.c Diff: diff --cc ext/standard/math.c index 6059f3d,e004173..73face4 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@@ -390,7 -353,15 +390,15 @@@ PHP_FUNCTION(round } if (ZEND_NUM_ARGS() >= 2) { - places = (int) precision; -#if SIZEOF_LONG > SIZEOF_INT ++#if SIZEOF_ZEND_LONG > SIZEOF_INT + if (precision >= 0) { + places = precision > INT_MAX ? INT_MAX : (int)precision; + } else { + places = precision <= INT_MIN ? INT_MIN+1 : (int)precision; + } + #else + places = precision; + #endif } convert_scalar_to_number_ex(value);

« previous php.cvs (#90425) next »