From a894b295b68c9435293e96f12f1690c31f410ca5 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 29 Dec 2020 14:44:45 +1000 Subject: [PATCH] CPU/CodeCache: Fix assertion failure when patching in double branch --- src/core/cpu_code_cache.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index ceea4d7d1..a334aaa41 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -652,12 +652,13 @@ void FlushBlock(CodeBlock* block) #endif // if it's been invalidated it won't be in the page map - if (block->invalidated) + if (!block->invalidated) RemoveBlockFromPageMap(block); UnlinkBlock(block); #ifdef WITH_RECOMPILER - RemoveBlockFromHostCodeMap(block); + if (!block->invalidated) + RemoveBlockFromHostCodeMap(block); #endif s_blocks.erase(iter);