diff --git a/NEWS b/NEWS index 86840851bde..657d4f6b5ee 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,8 @@ PHP NEWS . Remove EXPERIMENTAL flag. (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 - General improvements: diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index f42d3363b3a..bd9d6608a3d 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -560,7 +560,7 @@ PHP_FUNCTION(bcscale) return; } - BCG(bc_precision) = (new_scale < 0) ? 0 : new_scale; + BCG(bc_precision) = ((int)new_scale < 0) ? 0 : new_scale; RETURN_TRUE; } diff --git a/ext/bcmath/tests/bug60377.phpt b/ext/bcmath/tests/bug60377.phpt new file mode 100644 index 00000000000..7c420029177 --- /dev/null +++ b/ext/bcmath/tests/bug60377.phpt @@ -0,0 +1,13 @@ +--TEST-- +bcscale related problem on 64bits platforms +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +ALIVE