diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp index ded0c003a7..59a4d8314d 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp @@ -153,7 +153,7 @@ void JitBaseBlockCache::FinalizeBlock(JitBlock& b, bool block_link, const u8* co for (u32 block = pAddr / 32; block <= (pAddr + (b.originalSize - 1) * 4) / 32; ++block) valid_block.Set(block); - block_map[std::make_pair(pAddr + 4 * b.originalSize - 1, pAddr)] = block_num; + block_map[std::make_pair(pAddr + 4 * b.originalSize - 1, pAddr)] = &b; if (block_link) { @@ -233,7 +233,7 @@ void JitBaseBlockCache::InvalidateICache(u32 address, const u32 length, bool for auto it = block_map.lower_bound(std::make_pair(pAddr, 0)); while (it != block_map.end() && it->first.second < pAddr + length) { - DestroyBlock(blocks[it->second], true); + DestroyBlock(*it->second, true); it = block_map.erase(it); } diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.h b/Source/Core/Core/PowerPC/JitCommon/JitCache.h index b048c92f7a..0be888eb49 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.h +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.h @@ -177,7 +177,7 @@ private: // Map indexed by the physical memory location. // It is used to invalidate blocks based on memory location. - std::map, u32> block_map; // (end_addr, start_addr) -> number + std::map, JitBlock*> block_map; // (end_addr, start_addr) -> block // Map indexed by the physical address of the entry point. // This is used to query the block based on the current PC in a slow way.