[pull] master from php:master - #1258
Merged
Merged
Conversation
RFC: https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_using_as_a_constant_and_compile_time_alias Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
…23607) When one iterator points at a hole and another at the next live bucket, the relocation loop must include the iterator at that bucket's original position. Otherwise it is moved to the following bucket's destination, causing a nested by-reference foreach to skip an element. Add regression coverage for packed-to-hash conversion and compaction of a full mixed table.
GregorianToSdn(), JulianToSdn(), JewishToSdn() and FrenchToSdn() took C int parameters while every PHP_FUNCTION() calling them parses zend_long, so the arguments were implicitly narrowed before any range check ran. Values whose low 32 bits alias into the accepted range slipped past the guards inside the helpers: gregoriantojd(1 + 2**32, 1, 1) returned the Julian Day of month 1 instead of 0. cal_to_jd() and cal_days_in_month() were affected the same way through cal_to_jd_func_t. Widen the parameters so the existing guards see the value the user passed. The typedef's parameter names were also in the wrong order and are fixed to match the callees. JewishToSdn() passes its year on to FindStartOfYear(), whose first two outputs are int, so the year is narrowed once in JewishToSdn() itself, right after the check that leaves both year and year + 1 within int range. FindStartOfYear() keeps its int parameter and stays unaware of bounds its caller enforces. Widening JewishToSdn() additionally removes a signed overflow: `sdn = tishri1 + day - 1` was computed in int, so year 5879542 returned a negative Julian Day. juliantojd_overflow.phpt asserted the aliased result for year 6000000000, which is past the supported maximum enforced since GH-22602 (INT_MAX - 4800); it now returns 0, and the test covers the largest accepted year instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )