Repository navigation
engine: keep AutoFill text series from panicking or wrapping on i64 overflow - #1360
Merged
aiongg merged 1 commit intoOct 22, 2026
Merged
Conversation
aiongg
added a commit
to aiongg/gridcraft
that referenced
this pull request
Oct 22, 2026
…the source in a corner (whole rows into whole columns aborted the app) crates/engine/src/fill.rs: kept both tests (storytold#1360 and storytold#2005).
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.
AutoFill of a text series whose numbers sit near
i64::MAX(e.g.X 0,X 9223372036854775807) panicked withattempt to add with overflowin debug and silently wrapped to a wrong value in release, because the detected step isi64::MAXandPattern::valuecomputedbase + step * k * signandn.abs()with unchecked integer arithmetic on input-derived numbers.The
Pattern::TextNumarm now useschecked_mul/checked_add/checked_sub/checked_abs; when the series would overflow it yieldsNone, the existing "can't extend this series" fallback already used by month series, so the cell keeps its source value instead of panicking or writing a wrapped number. Regression testtext_series_near_i64_max_neither_wraps_nor_panicsincrates/engine/src/fill.rssets up the two-cell source, runsedit.autoFill, and asserts the overflowing target keepsX 0; it failed with the overflow panic before the fix and passes after. Quarter suffixes (Qtr3,Quarter 3) now go through the same checked path, and all existing fill and fill-series tests still pass.Partially addresses #1307 (finding 4, AutoFill overflow). Targeted tests green locally;
cargo xtask cileft to the project runners.