From 3e16dbfc3781ed6bccc350c849f41cced06a4a2d Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 17 Sep 2022 14:26:49 +1000 Subject: [PATCH] System: Fix crash when toggling memory exceptions off --- src/core/system.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index 3bb244ea7..c9a0214db 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -3124,7 +3124,12 @@ void System::CheckForSettingsChanges(const Settings& old_settings) { Host::AddOSDMessage(Host::TranslateStdString("OSDMessage", "Recompiler options changed, flushing all blocks."), 5.0f); - CPU::CodeCache::Flush(); + + // changing memory exceptions can re-enable fastmem + if (g_settings.cpu_recompiler_memory_exceptions != old_settings.cpu_recompiler_memory_exceptions) + CPU::CodeCache::Reinitialize(); + else + CPU::CodeCache::Flush(); if (g_settings.cpu_recompiler_icache != old_settings.cpu_recompiler_icache) CPU::ClearICache();