From da0830ca699de1ba7b28a0a4383499f6a048cea6 Mon Sep 17 00:00:00 2001 From: LinesPrower Date: Wed, 7 Oct 2009 18:27:51 +0000 Subject: [PATCH] More JIT bugfixing. How could I overlook this? git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4375 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp index 6a5c2ad2eb..e88dfda57d 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp @@ -63,7 +63,7 @@ using namespace Gen; bool JitBlock::ContainsAddress(u32 em_address) { // WARNING - THIS DOES NOT WORK WITH INLINING ENABLED. - return (em_address >= originalAddress && em_address < originalAddress + originalSize); + return (em_address >= originalAddress && em_address < originalAddress + 4 * originalSize); } bool JitBlockCache::IsFull() const @@ -201,7 +201,7 @@ bool JitBlock::ContainsAddress(u32 em_address) JitBlock &b = blocks[block_num]; b.originalFirstOpcode = Memory::Read_Opcode_JIT(b.originalAddress); Memory::Write_Opcode_JIT(b.originalAddress, (JIT_OPCODE << 26) | block_num); - block_map[std::make_pair(b.originalAddress + b.originalSize - 1, b.originalAddress)] = block_num; + block_map[std::make_pair(b.originalAddress + 4 * b.originalSize - 1, b.originalAddress)] = block_num; if (block_link) { for (int i = 0; i < 2; i++) @@ -379,7 +379,7 @@ bool JitBlock::ContainsAddress(u32 em_address) address &= ~0x1f; // destroy JIT blocks // !! this works correctly under assumption that any two overlapping blocks end at the same address - std::map, u32>::iterator it1 = block_map.lower_bound(std::make_pair(address, 0)), it2 = it1, it; + std::map, u32>::iterator it1 = block_map.lower_bound(std::make_pair(address, 0)), it2 = it1, it; while (it2 != block_map.end() && it2->first.second < address + 0x20) { DestroyBlock(it2->second, true);