From 8a535ed5d47c8ce4551a752380683e34d61b3c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 21 Jul 2024 18:56:22 +0200 Subject: [PATCH] Bugfix in DoIRInst, thanks Nemoumbra --- Core/MIPS/IR/IRNativeCommon.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Core/MIPS/IR/IRNativeCommon.cpp b/Core/MIPS/IR/IRNativeCommon.cpp index b96f6d83bc..b1ab8c74b9 100644 --- a/Core/MIPS/IR/IRNativeCommon.cpp +++ b/Core/MIPS/IR/IRNativeCommon.cpp @@ -152,13 +152,14 @@ void IRNativeBackend::DoMIPSInst(uint32_t value) { MIPSInterpret(op); } +// This is called from IR->JIT implementation to fall back to the IR interpreter for missing ops. +// Not fast. uint32_t IRNativeBackend::DoIRInst(uint64_t value) { - IRInst inst[2]; - memcpy(&inst, &value, sizeof(inst)); - + IRInst inst[2]{}; + memcpy(&inst[0], &value, sizeof(value)); if constexpr (enableDebugStats) debugSeenNotCompiledIR[(uint8_t)inst[0].op]++; - + // Doesn't really matter what value it returns as PC. inst[1].op = IROp::ExitToPC; return IRInterpret(currentMIPS, &inst[0]); }