Loader: fix thunk block overflow, capacity enforcement, flush errors, and leaks #1306
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1306
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1306"
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?
@geiyiliyabumo on GitHub · 2026-11-24 17:17 UTC · original
geiyiliyabumo:test/loader-thunks-audit→main· +167 −7 · 1 files · 1 commits · openSummary
Audits \crates/victory-loader/src/thunks.rs\ and fixes 4 bugs:
Verification
AI-assisted; synthetic tests only, no game files.
@Marvisak on GitHub · 2026-11-25 02:34 UTC · original
Automated triage for the maintainers.
The four fixes in
crates/victory-loader/src/thunks.rsdo not address failures that can happen on main.ThunkBlock::newis called only fromLoadedImage::bind_importsinwindows.rs, behindif !unresolved.is_empty(). So the count is never zero, andcount * 32cannot overflow for an import list. On main, the page-rounded capacity only allows more slots than requested, never fewer, soemitcannot overrun. The newDropfrees memory only on error paths wherebind_importsreturnsErrand the image is never run. On x64,FlushInstructionCachefailing is not a realistic case. The stub-encoding test is reasonable on its own, but it checks the bytes the code already writes.If you have a case where one of these paths is reached, please describe it and push a change; a small PR adding only the encoding/round-trip test would also be welcome. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the
triage: proposed closelabel. No CI ran on this head.Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.