diff --git a/NEWS b/NEWS index 1467bac7be467..87d03eee1462f 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ PHP NEWS . Fixed bug GH-19637 (Incorrect Closure scope for FCC in constant expression). (timwolla) . Fixed bug GH-19613 (Stale array iterator pointer). (ilutov) + . Fixed bug GH-19679 (zend_ssa_range_widening may fail to converge). (Arnaud) - Date: . Fixed date_sunrise() and date_sunset() with partial-hour UTC offset. @@ -57,8 +58,7 @@ PHP NEWS . Fixed bug GH-19476 (pipe operator fails to correctly handle returning by reference). (alexandre-daubois) . The report_memleaks INI directive has been deprecated. (alexandre-daubois) - . Constant redeclaration is deprecated and this behavior will trigger an - error in PHP 9. (alexandre-daubois) + . Constant redeclaration has been deprecated. (alexandre-daubois) . Fixed OSS-Fuzz #439125710 (Pipe cannot be used in write context). (nielsdos) . Added support for configuring the URI parser for the FTP/FTPS as well as diff --git a/UPGRADING b/UPGRADING index 9973a1a42eb7d..1a902108c234d 100644 --- a/UPGRADING +++ b/UPGRADING @@ -360,8 +360,7 @@ PHP 8.5 UPGRADE NOTES RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_debuginfo_returning_null . The report_memleaks INI directive has been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_report_memleaks_ini_directive - . Constant redeclaration is deprecated and that behavior will trigger an - error in PHP 9. + . Constant redeclaration has been deprecated. RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_constant_redeclaration . Enacted the follow-up phase of the "Path to Saner Increment/Decrement operators" RFC, meaning that incrementing non-numeric strings is now diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index f146a741439d5..62e04cb0e306b 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -1623,12 +1623,16 @@ static bool zend_inference_widening_meet(zend_ssa_var_info *var_info, zend_ssa_r r->min < var_info->range.min) { r->underflow = 1; r->min = ZEND_LONG_MIN; + } else { + r->min = var_info->range.min; } if (r->overflow || var_info->range.overflow || r->max > var_info->range.max) { r->overflow = 1; r->max = ZEND_LONG_MAX; + } else { + r->max = var_info->range.max; } if (var_info->range.min == r->min && var_info->range.max == r->max && diff --git a/Zend/tests/gh19679.phpt b/Zend/tests/gh19679.phpt new file mode 100644 index 0000000000000..ab7f3be344d22 --- /dev/null +++ b/Zend/tests/gh19679.phpt @@ -0,0 +1,22 @@ +--TEST-- +GH-19679: zend_ssa_range_widening does not converge +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true)