Fix fastmem building on ARM64 Macs (#841)

This commit is contained in:
WaluigiWare64 2020-12-11 00:41:53 +00:00 committed by GitHub
parent 8530c099bc
commit a9223d6c0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 3 deletions

View File

@ -162,8 +162,13 @@ static void SigsegvHandler(int sig, siginfo_t* info, void* rawContext)
#endif
#else
desc.EmulatedFaultAddr = (u8*)context->uc_mcontext.fault_address - curArea;
desc.FaultPC = (u8*)context->uc_mcontext.pc;
#ifdef __APPLE__
desc.EmulatedFaultAddr = (u8*)context->uc_mcontext->__es.__far - curArea;
desc.FaultPC = (u8*)context->uc_mcontext->__ss.__pc;
#else
desc.EmulatedFaultAddr = (u8*)context->uc_mcontext.fault_address - curArea;
desc.FaultPC = (u8*)context->uc_mcontext.pc;
#endif
#endif
if (ARMJIT_Memory::FaultHandler(desc))
@ -175,7 +180,11 @@ static void SigsegvHandler(int sig, siginfo_t* info, void* rawContext)
context->uc_mcontext.gregs[REG_RIP] = (u64)desc.FaultPC;
#endif
#else
context->uc_mcontext.pc = (u64)desc.FaultPC;
#ifdef __APPLE__
context->uc_mcontext->__ss.__pc = (u64)desc.FaultPC;
#else
context->uc_mcontext.pc = (u64)desc.FaultPC;
#endif
#endif
return;
}