CPU/CodeCache: Don't choke on indirect branches in delay slot

Fixes emulator crash/memory usage explosion in Shadow Master.
This commit is contained in:
Connor McLaughlin
2020-12-14 01:21:49 +10:00
parent d7c3a0137f
commit 5164840c25
3 changed files with 25 additions and 0 deletions

View File

@ -527,6 +527,11 @@ bool CompileBlock(CodeBlock* block)
Log_WarningPrintf("Conditional branch delay slot at %08X, skipping block", cbi.pc);
return false;
}
if (!IsDirectBranchInstruction(cbi.instruction))
{
Log_WarningPrintf("Indirect branch in delay slot at %08X, skipping block", cbi.pc);
return false;
}
// change the pc for the second branch's delay slot, it comes from the first branch
const CodeBlockInstruction& prev_cbi = block->instructions.back();