mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 19:00:17 +02:00
FEXCore: Ignore inactive JIT guard ranges
This commit is contained in:
1 parent
d028c7942b
commit
35518a5fa0
2 files changed
+12
-3
No files matched your search
@@ -576,7 +576,8 @@ bool SignalDelegator::HandleFrontendSIGSEGV(FEXCore::Core::InternalThreadState*
|
||||
}
|
||||
|
||||
#ifdef ARCHITECTURE_arm64
|
||||
if (Signal == SIGSEGV && SigInfo.si_code == SEGV_ACCERR && SigInfo.si_addr >= reinterpret_cast<void*>(Thread->JITGuardPage) &&
|
||||
if (Signal == SIGSEGV && SigInfo.si_code == SEGV_ACCERR && Thread->JITGuardPage &&
|
||||
SigInfo.si_addr >= reinterpret_cast<void*>(Thread->JITGuardPage) &&
|
||||
SigInfo.si_addr < reinterpret_cast<void*>(Thread->JITGuardPage + FEXCore::Utils::FEX_PAGE_SIZE)) {
|
||||
FEXCore::UncheckedLongJump::ManuallyLoadJumpBuf(Thread->RestartJump, Thread->JITGuardOverflowArgument,
|
||||
ArchHelpers::Context::GetArmGPRs(UContext), ArchHelpers::Context::GetArmFPRs(UContext),
|
||||
|
||||
@@ -4,9 +4,17 @@
|
||||
#include <FEXCore/Utils/LongJump.h>
|
||||
|
||||
namespace FEX::Windows::JITGuardPage {
|
||||
static constexpr bool IsAddressInJITGuardPage(uintptr_t GuardPage, uintptr_t Address) {
|
||||
return GuardPage != 0 && Address >= GuardPage && Address < GuardPage + FEXCore::Utils::FEX_PAGE_SIZE;
|
||||
}
|
||||
|
||||
static_assert(!IsAddressInJITGuardPage(0, 0));
|
||||
static_assert(IsAddressInJITGuardPage(0x1000, 0x1000));
|
||||
static_assert(IsAddressInJITGuardPage(0x1000, 0x1fff));
|
||||
static_assert(!IsAddressInJITGuardPage(0x1000, 0x2000));
|
||||
|
||||
static inline bool HandleJITGuardPage(FEXCore::Core::InternalThreadState* Thread, void* Address, uint64_t* GPRs, __uint128_t* FPRs, uint64_t* PC) {
|
||||
if (Address >= reinterpret_cast<void*>(Thread->JITGuardPage) &&
|
||||
Address < reinterpret_cast<void*>(Thread->JITGuardPage + FEXCore::Utils::FEX_PAGE_SIZE)) {
|
||||
if (IsAddressInJITGuardPage(Thread->JITGuardPage, reinterpret_cast<uintptr_t>(Address))) {
|
||||
FEXCore::UncheckedLongJump::ManuallyLoadJumpBuf(Thread->RestartJump, Thread->JITGuardOverflowArgument, GPRs, FPRs, PC);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user