FEX: Fixes SIGILL reporting

Two bug fixes here.
- We weren't reporting a correctl ErrorRegister. Needs to contain
  PF_INSTR at least.
- We weren't setting siginfo->si_addr in the case of `FaultToTopAndGeneratedException`

Fixes Mafia 2 (Classic)
This commit is contained in:
Ryan Houdek committed 2025-09-18 11:26:15 -07:00
1 parent 3058a825b7
commit dd4f508b77
2 files changed
+16 -10

No files matched your search

@@ -4973,7 +4973,7 @@ void OpDispatchBuilder::InvalidOp(OpcodeArgs) {
void OpDispatchBuilder::NoExecOp(OpcodeArgs) {
BreakOp(Op, FEXCore::IR::BreakDefinition {
.ErrorRegister = 0,
.ErrorRegister = X86State::X86_PF_PROT | X86State::X86_PF_USER | X86State::X86_PF_INSTR,
.Signal = Core::FAULT_SIGSEGV,
.TrapNumber = X86State::X86_TRAPNO_PF,
.si_code = 2, // SEGV_ACCERR