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).
This commit is contained in:
Pokechu22 2022-12-01 16:04:53 -08:00
parent 7cd9a78ebf
commit 4f4bd57fe9

View File

@ -12,6 +12,7 @@
#include <fmt/format.h>
#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("<i>%1</i>").arg(tr("(ppc)")));
m_host_asm_widget->setHtml(QStringLiteral("<i>%1</i>").arg(tr("(host)")));