CPU/CodeCache: Don't create a branch block with no delay slot

Can't compile that.
This commit is contained in:
Stenzek 2024-09-26 20:55:13 +10:00
parent 2e4eaeafdc
commit b36e2ce6be
No known key found for this signature in database
1 changed files with 5 additions and 0 deletions

View File

@ -934,6 +934,11 @@ bool CPU::CodeCache::ReadBlockInstructions(u32 start_pc, BlockInstructionList* i
{
// Away to the int you go!
ERROR_LOG("Instruction read failed at PC=0x{:08X}, truncating block.", pc);
// If the last instruction was a branch, we need the delay slot in the block to compile it.
if (is_branch_delay_slot)
instructions->pop_back();
break;
}