From c9c5437cb836c44e862f99fc5c4a879a5b4fb966 Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 17 Jan 2017 22:59:03 +0100 Subject: [PATCH] JitCache: Fix links_to updates on destroying blocks. --- Source/Core/Core/PowerPC/JitCommon/JitCache.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp index aebff21af8..8da453eef9 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp @@ -325,13 +325,16 @@ void JitBaseBlockCache::DestroyBlock(JitBlock& block, bool invalidate) UnlinkBlock(block); // Delete linking addresses - auto it = links_to.equal_range(block.effectiveAddress); - while (it.first != it.second) + for (const auto& e : block.linkData) { - if (it.first->second == &block) - it.first = links_to.erase(it.first); - else - it.first++; + auto it = links_to.equal_range(e.exitAddress); + while (it.first != it.second) + { + if (it.first->second == &block) + it.first = links_to.erase(it.first); + else + it.first++; + } } // Raise an signal if we are going to call this block again