Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Zend/Optimizer/zend_inference.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
22 changes: 22 additions & 0 deletions Zend/tests/gh19679.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--TEST--
GH-19679: zend_ssa_range_widening does not converge
--SKIPIF--
<?php
if (PHP_INT_SIZE !== 8) {
die('skip output depends PHP_INT_SIZE=8');
}
?>
--FILE--
<?php
function test() {
$a = PHP_INT_MIN+1;
$b = 0;
while ($b++ < 3) {
$a = (int) ($a-- - $b - 1);
}
return $a;
}
var_dump(test() == PHP_INT_MIN);
?>
--EXPECT--
bool(true)