Pin seh::Context::set_from_thread_state and the FXSAVE accessors with unit tests #589
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T10:25:17Z.
The Windows x64
CONTEXTdecoder incrates/victory-loader/src/native/seh/context.rshas no tests: only the struct size/offset asserts are pinned.Context::set_from_thread_statemaps Darwin'sx86_thread_state64(21 u64 words) into theCONTEXTgpr order (rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8-r15, rip, eflags, cs, fs, gs) and fixes ds/es/ss to 0x2B. Thexmm/xmm_mut/set_mxcsraccessors over the FXSAVE image are also untested.Add unit tests: a distinct value per thread-state word, asserting each gpr slot, rip, the eflags truncation to u32, the three segments read from the state, ds/es/ss = 0x2B; and
set_mxcsrwriting bothmx_csrand the little-endian bytes inflt[1][8..12], plusxmm(i)addressingflt[10 + i]. Pure mapping, no Mach calls; runs undercargo test --target x86_64-apple-darwin -p victory-loader. No behaviour change.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T10:25:18Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T10:25:27Z.
Claimed by @AnastasisKon. Open a draft pull request with
Refs #589in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:37:11Z.
/release - done: PR #590 pins
seh::Context::set_from_thread_stateand the FXSAVE accessors. Carried in my fork'smain(69146296), gate green.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T12:41:49Z.
/release - done: PR #590 pins
seh::Context::set_from_thread_stateand the FXSAVE accessors. Carried in my fork'smain(69146296), gate green.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T12:41:58Z.
Released. This issue is free to claim.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T17:06:03Z.
The tests this asks for are in the tree already (the mapping, the FXSAVE accessors, the clock scaling and
normaliseare all pinned); closing.