iliaa Fri, 06 Aug 2010 20:04:29 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=301939
Log: Another fix for issue indentified in bug #52550 Bug: http://bugs.php.net/52550 (Analyzed) integer undefined behaviors executed during "make test" Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/math.c U php/php-src/trunk/ext/standard/math.c Modified: php/php-src/branches/PHP_5_3/ext/standard/math.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/standard/math.c 2010-08-06 19:55:10 UTC (rev 301938) +++ php/php-src/branches/PHP_5_3/ext/standard/math.c 2010-08-06 20:04:29 UTC (rev 301939) @@ -690,7 +690,11 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "base must be greater than 0"); RETURN_FALSE; } - RETURN_DOUBLE(log(num) / log(base)); + if (base == 1) { + RETURN_DOUBLE(NAN); + } else { + RETURN_DOUBLE(log(num) / log(base)); + } } /* }}} */ Modified: php/php-src/trunk/ext/standard/math.c =================================================================== --- php/php-src/trunk/ext/standard/math.c 2010-08-06 19:55:10 UTC (rev 301938) +++ php/php-src/trunk/ext/standard/math.c 2010-08-06 20:04:29 UTC (rev 301939) @@ -690,7 +690,11 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "base must be greater than 0"); RETURN_FALSE; } - RETURN_DOUBLE(log(num) / log(base)); + if (base == 1) { + RETURN_DOUBLE(NAN); + } else { + RETURN_DOUBLE(log(num) / log(base)); + } } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php