Use checked subtraction in port_descriptors::missed #459
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-logs
old-names
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!459
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-459"
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?
@ahmetbagci8 on GitHub · 2026-11-29 20:48 UTC · original
ahmetbagci8:fix/gpu-port-descriptors-missed-underflow→main· +60026 −5429 · 206 files · 660 commits · closed without mergingProblem
In crates/victory-gpu/src/port_descriptors.rs, missed() computes ((handle - a.start) >> 16) as usize with unchecked subtraction. If missed() is called with a handle < a.start (for example a handle from another heap), handle - a.start panics with integer underflow in debug builds.
Fix
Use handle.checked_sub(a.start).and_then(|d| a.writers.get((d >> 16) as usize)) and add unit test missed_handles_address_below_adopted_heap_start.
Verification
@TaynanGT on GitHub · 2026-11-30 17:05 UTC · original
mainhas moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the currentmainand open a new PR; I'll review it there.Pull request closed