From: Mateusz Kocielski Date: Sat, 19 Nov 2011 12:46:43 +0000 (+0000) Subject: - Fixed bug #60337 bcscale related crashed on 64bits platforms X-Git-Tag: php-5.5.0alpha1~859 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63b8ff76198e886133d28987d49dc1358629e814;p=php - Fixed bug #60337 bcscale related crashed on 64bits platforms --- diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index f42d3363b3..bd9d6608a3 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 0000000000..7c42002917 --- /dev/null +++ b/ext/bcmath/tests/bug60377.phpt @@ -0,0 +1,13 @@ +--TEST-- +bcscale related problem on 64bits platforms +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +ALIVE