From f94a08f12f98500c674079d152d0d63ef8c8bf84 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sun, 2 Apr 2023 22:06:22 +0200 Subject: [PATCH] mmu: avoid crash due to approximative fast mmu matching Fixes MINIDUMP-EA (Sonic Shuffle) --- core/hw/sh4/modules/mmu.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/hw/sh4/modules/mmu.cpp b/core/hw/sh4/modules/mmu.cpp index 49aa9ceeb..bda465e3e 100644 --- a/core/hw/sh4/modules/mmu.cpp +++ b/core/hw/sh4/modules/mmu.cpp @@ -467,7 +467,13 @@ retry_ITLB_Match: if (entry == 4) { - verify(mmach == false); +#ifndef FAST_MMU + verify(!mmach); +#else + // the matching may be approximative + if (mmach) + return MMU_ERROR_TLB_MISS; +#endif const TLB_Entry *tlb_entry; u32 lookup = mmu_full_lookup(va, &tlb_entry, rv);