mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:45:53 +01:00
[PR #903] [CLOSED] shims: guard SEH __try behind _MSC_VER for MinGW (MINGW-SEH-GUARD) #940
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#940
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/903
Author: @morodirule
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:fix/mingw-seh-guard📝 Commits (3)
93511b1shims: guard SEH __try behind _MSC_VER for MinGW (MINGW-SEH-GUARD)7e47b21dstorage: reject wrapped MinGW buffer ranges before VirtualQuery85c78e2dstorage: let MinGW guarded_move reach guard pages like MSVC📊 Changes
2 files changed (+57 additions, -0 deletions)
View changed files
📝
runtime/shims/dstorage.cpp(+47 -0)📝
runtime/shims/file_system.cpp(+10 -0)📄 Description
Claimed in the coordination issue as: MINGW-SEH-GUARD
Carries abnalstlll-byte's finding (file_system.cpp touch_pages); the same unguarded __try also blocked dstorage.cpp guarded_move and touch_pages, so all three sites are guarded.
Change: the three __try/__except blocks are now #ifdef _MSC_VER, following the existing startup_trace.h pattern. Other compilers probe with VirtualQuery: touch_pages treats a non-committed/guarded page as untouched (ReadFile refuses it as before); guarded_move returns false when a source page is unreadable or a destination page unwritable, keeping its E_DSTORAGE_ACCESS_VIOLATION contract. The MSVC branch is unchanged (diff is +45/-0).
Tests: x86_64-w64-mingw32-g++ -fsyntax-only and -c -O1 of both translation units pass (baseline: error: expected 'catch' before '__except' in both files). Linux native build unaffected (Windows-only shims; not in the portable subset). check_no_game_data.py PASS. No game files, no GPU. MSVC compile not available on this machine.
AI-assisted.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.