mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Fix a bug in DSP Jit where branches had a blockSize of zero.
Add some useful checking to J_CC/SetJumpTarget. Refactor increment/decrement and reuse code with increase/decrease. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5816 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -194,6 +194,8 @@ const u8 *DSPEmitter::Compile(int start_addr) {
|
||||
SetJumpTarget(rLoopCounterExit);
|
||||
}
|
||||
|
||||
blockSize[start_addr]++;
|
||||
|
||||
// End the block if we're at a loop end.
|
||||
if (opcode->branch ||
|
||||
(DSPAnalyzer::code_flags[addr] & DSPAnalyzer::CODE_LOOP_END) ||
|
||||
@ -201,8 +203,6 @@ const u8 *DSPEmitter::Compile(int start_addr) {
|
||||
break;
|
||||
}
|
||||
addr += opcode->size;
|
||||
|
||||
blockSize[start_addr]++;
|
||||
}
|
||||
|
||||
// ABI_RestoreStack(0);
|
||||
@ -210,6 +210,13 @@ const u8 *DSPEmitter::Compile(int start_addr) {
|
||||
RET();
|
||||
|
||||
blocks[start_addr] = (CompiledCode)entryPoint;
|
||||
if (blockSize[start_addr] == 0)
|
||||
{
|
||||
// just a safeguard, should never happen anymore.
|
||||
// if it does we might get stuck over in RunForCycles.
|
||||
ERROR_LOG(DSPLLE, "Block at 0x%04x has zero size", start_addr);
|
||||
blockSize[start_addr] = 1;
|
||||
}
|
||||
|
||||
return entryPoint;
|
||||
}
|
||||
|
Reference in New Issue
Block a user