- Fixed bug #60337 bcscale related crashed on 64bits platforms

This commit is contained in:
Mateusz Kocielski 2011-11-19 12:46:43 +00:00
parent 7439154ece
commit b141fb1afb
3 changed files with 16 additions and 1 deletions

2
NEWS
View file

@ -52,6 +52,8 @@ PHP NEWS
. Remove EXPERIMENTAL flag. (fat) . Remove EXPERIMENTAL flag. (fat)
. Added .phar to default authorized extensions. (fat) . Added .phar to default authorized extensions. (fat)
- BCmath:
. Fixed bug #60377 (bcscale related crashes on 64bits platforms) (shm)
11 Nov 2011, PHP 5.4.0 RC1 11 Nov 2011, PHP 5.4.0 RC1
- General improvements: - General improvements:

View file

@ -560,7 +560,7 @@ PHP_FUNCTION(bcscale)
return; return;
} }
BCG(bc_precision) = (new_scale < 0) ? 0 : new_scale; BCG(bc_precision) = ((int)new_scale < 0) ? 0 : new_scale;
RETURN_TRUE; RETURN_TRUE;
} }

View file

@ -0,0 +1,13 @@
--TEST--
bcscale related problem on 64bits platforms
--SKIPIF--
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
--FILE--
<?php
$var48 = bcscale(634314234334311);
$var67 = bcsqrt(false);
$var414 = bcadd(false,null,10);
die('ALIVE');
?>
--EXPECTF--
ALIVE