From 82e52d6dc0f08b3350f20343c414cc9a0057c971 Mon Sep 17 00:00:00 2001 From: Douglas Whittingham Date: Tue, 4 Aug 2026 09:38:51 -1000 Subject: [PATCH] Fix build: unknown_instruction reads ppc_state before it is declared moderngekko-vendor does not compile. The staticrecomp diagnostic block added to Interpreter::unknown_instruction sits above the `const auto& ppc_state` declaration it reads, and the file never includes StaticRecompCore.h for g_static_recomp_core, so the branch fails with 20 errors: Interpreter.cpp:304:20: error: use of undeclared identifier 'ppc_state' Interpreter.cpp:297:7: error: use of undeclared identifier 'g_static_recomp_core' Hoist the existing declaration above the new block rather than adding a second one, and add the missing include. No behaviour change. --- Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp index 4d0bbbfa59..2990bfee19 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp @@ -23,6 +23,7 @@ #include "Core/PowerPC/MMU.h" #include "Core/PowerPC/PPCTables.h" #include "Core/PowerPC/PowerPC.h" +#include "Core/PowerPC/StaticRecomp/StaticRecompCore.h" #include "Core/System.h" namespace @@ -290,6 +291,9 @@ void Interpreter::unknown_instruction(Interpreter& interpreter, UGeckoInstructio auto& system = interpreter.m_system; Core::CPUThreadGuard guard(system); + // Hoisted: the staticrecomp diagnostic block below was inserted above the + // original declaration site and reads ppc_state, so the branch did not build. + const auto& ppc_state = interpreter.m_ppc_state; const u32 last_pc = interpreter.m_last_pc; if (g_static_recomp_core && g_static_recomp_core->IsModuleActive()) { @@ -337,7 +341,6 @@ void Interpreter::unknown_instruction(Interpreter& interpreter, UGeckoInstructio Dolphin_Debugger::PrintCallstack(guard, Common::Log::LogType::POWERPC, Common::Log::LogLevel::LNOTICE); - const auto& ppc_state = interpreter.m_ppc_state; NOTICE_LOG_FMT( POWERPC, "\nIntCPU: Unknown instruction {:08x} at PC = {:08x} last_PC = {:08x} LR = {:08x}\n",