Repository navigation
Fix kqlRangeCount reporting an empty range for the Int256 minimum span with step -1 - #117212
Conversation
… span with step -1 `flooredCount` guarded the span subtraction against overflow but not the division. For a span of exactly `Int256::min()` and a step of -1 the quotient is not representable, the wide integer wraps back to the minimum, and the negative step count took the empty-range branch - so the function returned 0 for a range of 2^255 + 1 elements, where every neighbouring input correctly throws `The 'range' has too many rows to count`. Closes: #117103
|
Workflow [PR], commit [e1146ea] Summary: ❌
AI ReviewSummaryThis PR fixes the Final Verdict✅ No new findings. LLVM Coverage ReportMeasured on commit e1146ea.
Changed lines: Changed C/C++ lines covered: 6/7 (85.71%) · Uncovered code |
Build profile diff (arm_release)Comparing commit See the job log for details. |
Master now has `05056_map_combinator_state_stranded_on_throw`, so the new test takes the next free number. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Closes: #117103
Related: #112932
Changelog category (leave one):
Description
flooredCountguarded the span subtraction withcommon::subOverflowbut left the divisionspan / stepunguarded. The quotient of the minimum and -1 is not representable: the wide integerwraps back to the minimum,
stepscomes out negative, and the empty-range branch returned 0 for arange of 2^255 + 1 elements. Every neighbouring input, one closer to zero, correctly throws
The 'range' has too many rows to count.The overflowing pair is now rejected with that same exception before the division.
The regression was introduced by #112932 and only
exists in the unreleased KQL rewrite on
master, so it is not a released bug and has no changelogentry.
Test
05059_kql_range_count_int256_min.Workflow [PR]
Sync PR [sync-upstream/pr/117212]
Version info
26.10.1.296-master(included in26.10and later)