Re: com php-src: Swap min/max if min > max: ext/standard/mt_rand.c

From: Date: Tue, 09 Aug 2016 09:12:05 +0000
Subject: Re: com php-src: Swap min/max if min > max: ext/standard/mt_rand.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-93686@lists.php.net to get a copy of this message
Hi Leigh, last night's build started failing: https://revive.beccati.com/bamboo/browse/PHP-SRC-TESTS-890/test/case/11408420 The test failure seems related to some of the rand changes. Cheers On 08/08/2016 23:31, Leigh wrote:
Commit:    2ece5decb7c37d780c1e7df71de27fcf78cda0de
Author:    Leigh <leigh@php.net>         Mon, 8 Aug 2016 22:31:59 +0100
Parents: 99e3bb14307a6fb0bf777f68408ab07351c0d6ed Branches: PHP-7.1
Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=2ece5decb7c37d780c1e7df71de27fcf78cda0de
Log: Swap min/max if min > max Changed paths: M ext/standard/mt_rand.c Diff: diff --git a/ext/standard/mt_rand.c b/ext/standard/mt_rand.c index c0b1d0a..f2866c5 100644 --- a/ext/standard/mt_rand.c +++ b/ext/standard/mt_rand.c @@ -276,6 +276,7 @@ PHP_FUNCTION(mt_rand) if (UNEXPECTED(max < min)) { php_error_docref(NULL, E_WARNING, "max(" ZEND_LONG_FMT ") is smaller than min(" ZEND_LONG_FMT ")", max, min); + max ^= min ^= max ^= min; } if (BG(mt_rand_mode) == MT_RAND_MT19937) {
-- Matteo Beccati Development & Consulting - http://www.beccati.com/

« previous php.cvs (#93686) next »