From fa8bcfd67a2e56b9540aa615a3dc46d2c46188a5 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Tue, 6 Feb 2024 12:31:38 +0000 Subject: [PATCH] Clean up access to possible nullptr Patch suggested by @Sonicadvance1 --- FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp index 46051c22c..536f35598 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp @@ -112,8 +112,6 @@ void OpDispatchBuilder::SyscallOp(OpcodeArgs) { auto NewRIP = GetRelocatedPC(Op, -Op->InstSize); _StoreContext(GPRSize, GPRClass, NewRIP, offsetof(FEXCore::Core::CPUState, rip)); - const auto& GPRIndicesRef = *GPRIndexes; - OrderedNode *Arguments[SyscallArgs] { InvalidNode, InvalidNode, @@ -124,7 +122,7 @@ void OpDispatchBuilder::SyscallOp(OpcodeArgs) { InvalidNode, }; for (size_t i = 0; i < NumArguments; ++i) { - Arguments[i] = LoadGPRRegister(GPRIndicesRef[i]); + Arguments[i] = LoadGPRRegister(GPRIndexes->at(i)); } if (IsSyscallInst) {