JitCache: Fix links_to updates on destroying blocks.

This commit is contained in:
degasus 2017-01-17 22:59:03 +01:00
parent 46c33df485
commit c9c5437cb8
1 changed files with 9 additions and 6 deletions

View File

@ -325,7 +325,9 @@ void JitBaseBlockCache::DestroyBlock(JitBlock& block, bool invalidate)
UnlinkBlock(block); UnlinkBlock(block);
// Delete linking addresses // Delete linking addresses
auto it = links_to.equal_range(block.effectiveAddress); for (const auto& e : block.linkData)
{
auto it = links_to.equal_range(e.exitAddress);
while (it.first != it.second) while (it.first != it.second)
{ {
if (it.first->second == &block) if (it.first->second == &block)
@ -333,6 +335,7 @@ void JitBaseBlockCache::DestroyBlock(JitBlock& block, bool invalidate)
else else
it.first++; it.first++;
} }
}
// Raise an signal if we are going to call this block again // Raise an signal if we are going to call this block again
WriteDestroyBlock(block); WriteDestroyBlock(block);