fix(interpreter): prevent brace step overflow#1825
Merged
chaliy merged 1 commit intoJun 2, 2026
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | b4eb923 | Commit Preview URL | Jun 02 2026, 09:27 AM |
0c6d99e to
b4eb923
Compare
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.
Motivation
..stepvalues could overflow or leave the loop unadvanced, bypassing the existing range-size cap and causing panics or unbounded resource growth.Description
i128and iteratingiandendasi128so valid largei64steps cannot overflow during iteration.MAX_BRACE_RANGE) and the existing validation logic that rejects zero or non-numeric steps.test_try_expand_range_numeric_large_step_does_not_overflowthat asserts correct behavior for ascending and descending large-step numeric ranges neari64bounds.crates/bashkit/src/interpreter/mod.rs.Testing
cargo fmt --checkand it passed.cargo test -p bashkit test_try_expand_range_numeric_large_step_does_not_overflow --liband it passed.cargo test -p bashkit test_try_expand_range_alpha_large_step_does_not_loop --liband it passed.Codex Task