diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp index 59a4d8314d..ad15d0f449 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp @@ -159,7 +159,7 @@ void JitBaseBlockCache::FinalizeBlock(JitBlock& b, bool block_link, const u8* co { for (const auto& e : b.linkData) { - links_to.emplace(e.exitAddress, block_num); + links_to.emplace(e.exitAddress, &b); } LinkBlock(b); @@ -295,7 +295,7 @@ void JitBaseBlockCache::LinkBlock(JitBlock& b) for (auto iter = ppp.first; iter != ppp.second; ++iter) { - JitBlock& b2 = blocks[iter->second]; + JitBlock& b2 = *iter->second; if (b.msrBits == b2.msrBits) LinkBlockExits(b2); } @@ -307,7 +307,7 @@ void JitBaseBlockCache::UnlinkBlock(const JitBlock& b) for (auto iter = ppp.first; iter != ppp.second; ++iter) { - JitBlock& sourceBlock = blocks[iter->second]; + JitBlock& sourceBlock = *iter->second; if (sourceBlock.msrBits != b.msrBits) continue; @@ -340,7 +340,7 @@ void JitBaseBlockCache::DestroyBlock(JitBlock& b, bool invalidate) auto it = links_to.equal_range(b.effectiveAddress); while (it.first != it.second) { - if (it.first->second == &b - &blocks[0]) + if (it.first->second == &b) it.first = links_to.erase(it.first); else it.first++; diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.h b/Source/Core/Core/PowerPC/JitCommon/JitCache.h index 0be888eb49..8c4bc04e2e 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.h +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.h @@ -173,7 +173,7 @@ private: // links_to hold all exit points of all valid blocks in a reverse way. // It is used to query all blocks which links to an address. - std::multimap links_to; // destination_PC -> number + std::multimap links_to; // destination_PC -> number // Map indexed by the physical memory location. // It is used to invalidate blocks based on memory location.