diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index fc676eb5d7..e3451286c3 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -66,6 +66,11 @@ public: GeIntrHandler() : IntrHandler(PSP_GE_INTR) {} bool run(PendingInterrupt& pend) override { + if (ge_pending_cb.empty()) { + ERROR_LOG_REPORT(SCEGE, "Unable to run GE interrupt: no pending interrupt"); + return false; + } + GeInterruptData intrdata = ge_pending_cb.front(); DisplayList* dl = gpu->getList(intrdata.listid); diff --git a/Core/MIPS/x86/Jit.cpp b/Core/MIPS/x86/Jit.cpp index e381efc04e..de02a2802e 100644 --- a/Core/MIPS/x86/Jit.cpp +++ b/Core/MIPS/x86/Jit.cpp @@ -603,15 +603,23 @@ void Jit::Comp_ReplacementFunc(MIPSOpcode op) } } + // Hack for old savestates: Avoid stack overflow (MIPSCompileOp/CompReplacementFunc) + // Not sure about the cause. + Memory::Opcode origInstruction = Memory::Read_Instruction(GetCompilerPC(), true); + if (origInstruction.encoding == op.encoding) { + ERROR_LOG(HLE, "Replacement broken (savestate problem?): %08x", op.encoding); + return; + } + if (disabled) { - MIPSCompileOp(Memory::Read_Instruction(GetCompilerPC(), true)); + MIPSCompileOp(origInstruction); } else if (entry->jitReplaceFunc) { MIPSReplaceFunc repl = entry->jitReplaceFunc; int cycles = (this->*repl)(); if (entry->flags & (REPFLAG_HOOKENTER | REPFLAG_HOOKEXIT)) { // Compile the original instruction at this address. We ignore cycles for hooks. - MIPSCompileOp(Memory::Read_Instruction(GetCompilerPC(), true)); + MIPSCompileOp(origInstruction); } else { FlushAll(); MOV(32, R(ECX), M(&mips_->r[MIPS_REG_RA]));