Return early on empty range in inplace::views_gone #351
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/351"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from TaynanGT/Vice-Tay. Originally posted by ahmetbagci8 on 2026-11-27T19:11:01Z.
Summary
In
crates/victory-gpu/src/inplace.rs,views_gone(at, 0)computedend = at.saturating_add(0) = atand calledv.views.range(at.saturating_add(1)..end)whenv.viewswas non-empty, which panics inBTreeMap::range(range start is greater than range end). Even without the panic,firstwould match and remove any view coveringatdespite[at, at + 0)being empty.Changes
len == 0at the start ofviews_gone.views_gone_empty_range_leaves_existing_views_alone.Tested
cargo test -p victory-gpu --lib inplace:9 passed; 0 failed; 0 ignoredcargo clippy -p victory-gpu --tests: clean (0 warnings)Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T19:27:53Z.
@ahmetbagci8 Merged as
1d83085. The regression test keeps the mapped view for an empty range and still removes it for a non-empty range. Both CI test suites and Clippy passed.