Fix potential crash looking up block_num.

This commit is contained in:
Unknown W. Brackets committed 2013-04-28 20:59:13 -07:00
1 parent 31f9d69e5a
commit fcfcadaef2
3 files changed
+8 -3

No files matched your search

+6 -1
View File
@@ -117,7 +117,12 @@ u32 Read_Instruction(u32 address)
if (MIPS_IS_EMUHACK(inst) && MIPSComp::jit)
{
JitBlockCache *bc = MIPSComp::jit->GetBlockCache();
return bc->GetOriginalFirstOp(bc->GetBlockNumberFromEmuHackOp(inst));
int block_num = bc->GetBlockNumberFromEmuHackOp(inst);
if (block_num >= 0) {
return bc->GetOriginalFirstOp(block_num);
} else {
return inst;
}
} else {
return inst;
}