Repository navigation
Conversation
fuzeofficlal
left a comment
There was a problem hiding this comment.
Code review on 541938dc (static source inspection):
- P2 — Unrelated
emit/lower.rs(med3/nan_safe_min/nan_safe_max) changes bundled in this PR:- The diff modifies
crates/victory-shader/src/emit/lower.rs:2266-2295in addition toxmem.rs, which is unrelated to#2413(aliasesview end bounds) and appears to come from a separate branch/base. Please drop thelower.rshunk and rebase onto currentmain.
- The diff modifies
- P2 —
aliasesstill panics on empty (len == 0) queries (crates/victory-hle/src/modules/xmem.rs:405-419):- When
len == 0(e.g.,aliases(0x10000, 0, &mut out)),end == at, sophysical.views.range(at.saturating_add(1)..end)passes a reversed range (0x10001..0x10000) toBTreeMap::rangeand panics. Returning early whenend <= at(and adding a unit test for both empty and overflowing queries) completes the bounds fix.
- When
|
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
541938d to
f68ea14
Compare
f68ea14 to
73227f8
Compare
kotekompotek
left a comment
There was a problem hiding this comment.
LGTM on the fix itself (end<=at early-out, saturating_add on both bound comparisons, boundary tests all discriminate). Heads-up: #3037 contains this identical xmem/aliases change plus its write-watch fix — whichever merges second gets a conflict; may be worth rebasing one onto the other.
|
Automated triage for the maintainers. Thanks for the reply and for updating the description. The head is unchanged, and you agree the guards in Generated by Claude Code |
|
Removed the decompiled-code attribution from the description per the asset policy. On the first point: you're right that �liases has no real caller on main except its own test, so these guards fix no live bug today. The saturating_add change is still correct defensive hygiene (the original code could panic on usize::MAX inputs), but I agree the early-return and tests are mostly defensive. If you'd prefer to close this and land just the core saturating_add one-liner as #90 already does in larger PRs (#1017, #39, #523, #1241), I'm fine with that — closing #3017. |
|
Closing to focus on new issues |
Fix #2413: use saturating_add for view end bounds in aliases
In xmem::aliases, end uses saturating_add but the view-range checks used unchecked addition (*base + size, base + size), which can overflow/panic. Use saturating_add consistently.
Additionally: