diff --git a/Core/MIPS/IR/IRCompBranch.cpp b/Core/MIPS/IR/IRCompBranch.cpp index 20d352b5c1..76b89fd669 100644 --- a/Core/MIPS/IR/IRCompBranch.cpp +++ b/Core/MIPS/IR/IRCompBranch.cpp @@ -300,9 +300,8 @@ void IRFrontend::Comp_Jump(MIPSOpcode op) { js.cancel = true; else ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr); - js.compiling = false; // TODO: Mark this block dirty or something? May be indication it will be changed by imports. - return; + // Continue so the block gets completed and crashes properly. } switch (op >> 26) { diff --git a/Core/MIPS/IR/IRJit.cpp b/Core/MIPS/IR/IRJit.cpp index ec9a2fdabb..4922fc13f2 100644 --- a/Core/MIPS/IR/IRJit.cpp +++ b/Core/MIPS/IR/IRJit.cpp @@ -224,6 +224,10 @@ void IRJit::RunLoopUntil(u64 globalticks) { u32 data = inst & 0xFFFFFF; IRBlock *block = blocks_.GetBlock(data); mips_->pc = IRInterpret(mips_, block->GetInstructions(), block->GetNumInstructions()); + if (!Memory::IsValidAddress(mips_->pc)) { + Core_ExecException(mips_->pc, mips_->pc, ExecExceptionType::JUMP); + break; + } } else { // RestoreRoundingMode(true); Compile(mips_->pc); diff --git a/Core/MIPS/MIPSInt.cpp b/Core/MIPS/MIPSInt.cpp index d562f97cde..8d015de485 100644 --- a/Core/MIPS/MIPSInt.cpp +++ b/Core/MIPS/MIPSInt.cpp @@ -55,6 +55,7 @@ static inline void DelayBranchTo(u32 where) { if (!Memory::IsValidAddress(where)) { + // TODO: What about misaligned? Core_ExecException(where, PC, ExecExceptionType::JUMP); } PC += 4;