From 3fc9f264d7b97d912661e39c12b8f28061aa2f2a Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 22 Oct 2020 11:08:57 +1000 Subject: [PATCH] CPUCodeCache: Fix extra page being invalidated on writing to edge --- src/core/cpu_code_cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/cpu_code_cache.h b/src/core/cpu_code_cache.h index ee03aea6b..d251779ef 100644 --- a/src/core/cpu_code_cache.h +++ b/src/core/cpu_code_cache.h @@ -131,7 +131,7 @@ ALWAYS_INLINE void InvalidateCodePages(PhysicalMemoryAddress address, u32 word_c { const u32 start_page = address / CPU_CODE_CACHE_PAGE_SIZE; const u32 end_page = (address + word_count * sizeof(u32)) / CPU_CODE_CACHE_PAGE_SIZE; - for (u32 page = start_page; page <= end_page; page++) + for (u32 page = start_page; page < end_page; page++) { if (Bus::m_ram_code_bits[page]) CPU::CodeCache::InvalidateBlocksWithPageIndex(page);