arm,arm64 rec: check fault location before attempting to rewrite

Ignore fault if pc isn't in the dynarec code buffer.

Fix for MINIDUMP-1S0, MINIDUMP-1RS
This commit is contained in:
Flyinghead 2023-09-20 17:25:09 +02:00
parent 403f1f635b
commit 2445739c0e
2 changed files with 7 additions and 1 deletions

View File

@ -778,6 +778,9 @@ bool Arm32Dynarec::rewrite(host_context_t& context, void *faultAddress)
u32 full;
};
if ((u8 *)context.pc < (u8 *)codeBuffer->getBase()
|| (u8 *)context.pc >= (u8 *)codeBuffer->getBase() + codeBuffer->getSize())
return false;
u32 *regs = context.reg;
arm_mem_op *ptr = (arm_mem_op *)context.pc;

View File

@ -2313,9 +2313,12 @@ public:
8,
};
jitWriteProtect(*codeBuffer, false);
//LOGI("Sh4Dynarec::rewrite pc %zx\n", context.pc);
u32 *code_ptr = (u32 *)CC_RX2RW(context.pc);
if ((u8 *)code_ptr < (u8 *)codeBuffer->getBase()
|| (u8 *)code_ptr >= (u8 *)codeBuffer->getBase() + codeBuffer->getSize())
return false;
jitWriteProtect(*codeBuffer, false);
u32 armv8_op = *code_ptr;
bool is_read = false;
u32 size = 0;