From 2f3bc5d38e490d1d2fe25b515bd5a006ba788eb1 Mon Sep 17 00:00:00 2001 From: wheremyfoodat Date: Fri, 16 Jun 2023 22:20:59 +0300 Subject: [PATCH] [CPU] fprs() should return std::span (Fixes memory corruption bug in threads.cpp) --- include/cpu_dynarmic.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/cpu_dynarmic.hpp b/include/cpu_dynarmic.hpp index 2682d0ee..daa25d03 100644 --- a/include/cpu_dynarmic.hpp +++ b/include/cpu_dynarmic.hpp @@ -138,9 +138,7 @@ public: // Get reference to array of FPRs. This array consists of the FPRs as single precision values // Hence why its base type is u32 - // Note: Dynarmic keeps 64 VFP registers as VFPv3 extends the VFP register set to 64 registers. - // However the 3DS ARM11 is an ARMv6k processor with VFPv2, so only the first 32 registers are actually used - std::span fprs() { return jit->ExtRegs(); } + std::span fprs() { return std::span(jit->ExtRegs()).first<32>(); } void setCPSR(u32 value) { jit->SetCpsr(value);