Repository navigation
Conversation
range_step_size_hint evaluated (end - start + 1) / step in i32, so a full-width scan panicked in debug (and wrapped in release) before the MAX_PARAMETERS cap could reject it. Compute that count in i64 instead.
00200200
force-pushed
the
reject-i32-parameter-scan-overflow
branch
from
October 5, 2026 11:52
5b660ef to
c670f92
Compare
Preserve the oversized parameter-scan fix and its regression test while retaining upstream's removal of speed_comparison_sort_order.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
--parameter-scanpanics in debug builds (and wraps in release) when the range is so wide that(end - start + 1) / stepoverflowsi32. That happens while computing the size hint, so the existing 100,000-parameter cap never gets a chance to reject the range.A narrower but still huge span overflows on the
+ 1instead:Integer scans now compute that count in
i64and return the usual "Parameter range is too large" error.Related to #920. The
next()overflow neari32::MAXis covered by #921; this is the remaining construction-time overflow called out in that review.On
masterthe two new unit tests panic withattempt to add/subtract with overflow. With this change they pass, along with the CLI testparameter_scan_full_i32_range_is_rejected.cargo test: 46 + 19 + 40.