From 4f4bd57fe94ee94bf25236b733641c7684ed4c48 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Thu, 1 Dec 2022 16:04:53 -0800 Subject: [PATCH] Fix crash when stopping emulation while the JIT widget is in use The call to analyzer.Analyze breaks when it attempts to read an instruction, as it eventually tries to read memory when Memory::m_pRAM is nullptr. Trying to read when execution is not paused in general seems like a bad idea (especially as analyzer.Analyze uses PowerPC::TryReadInstruction which can update icache - this is probably still a problem). --- Source/Core/DolphinQt/Debugger/JITWidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/Debugger/JITWidget.cpp b/Source/Core/DolphinQt/Debugger/JITWidget.cpp index 8a5f97c15f..99d4249504 100644 --- a/Source/Core/DolphinQt/Debugger/JITWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/JITWidget.cpp @@ -12,6 +12,7 @@ #include #include "Common/GekkoDisassembler.h" +#include "Core/Core.h" #include "Core/PowerPC/PPCAnalyst.h" #include "UICommon/Disassembler.h" @@ -130,7 +131,7 @@ void JITWidget::Update() if (!isVisible()) return; - if (!m_address) + if (!m_address || (Core::GetState() != Core::State::Paused)) { m_ppc_asm_widget->setHtml(QStringLiteral("%1").arg(tr("(ppc)"))); m_host_asm_widget->setHtml(QStringLiteral("%1").arg(tr("(host)")));