Clean up access to possible nullptr

Patch suggested by @Sonicadvance1
This commit is contained in:
Paulo Matos 2024-02-06 12:31:38 +00:00
parent 5e5984a29b
commit fa8bcfd67a

View File

@ -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) {