DSPEmitter: Fix infinite loop when an exception is present at the start of a block

This commit is contained in:
Pokechu22 2023-01-14 16:58:23 -08:00
commit dd76c0d1a0

View file

@ -243,6 +243,8 @@ void DSPEmitter::Compile(u16 start_addr)
auto& analyzer = m_dsp_core.DSPState().GetAnalyzer(); auto& analyzer = m_dsp_core.DSPState().GetAnalyzer();
while (m_compile_pc < start_addr + MAX_BLOCK_SIZE) while (m_compile_pc < start_addr + MAX_BLOCK_SIZE)
{ {
m_block_size[start_addr]++;
if (analyzer.IsCheckExceptions(m_compile_pc)) if (analyzer.IsCheckExceptions(m_compile_pc))
checkExceptions(m_block_size[start_addr]); checkExceptions(m_block_size[start_addr]);
@ -251,7 +253,6 @@ void DSPEmitter::Compile(u16 start_addr)
EmitInstruction(inst); EmitInstruction(inst);
m_block_size[start_addr]++;
m_compile_pc += opcode->size; m_compile_pc += opcode->size;
// If the block was trying to link into itself, remove the link // If the block was trying to link into itself, remove the link