From 8e2cf6c7b2a913b4d8dc8605df791c31467f241b Mon Sep 17 00:00:00 2001 From: Fabio Arnold Date: Wed, 18 Mar 2026 22:29:09 +0100 Subject: [PATCH] PPC: use unsigned int where wrapping is defined wrapping of signed integers is undefined behavior --- src/Cafe/HW/Espresso/Interpreter/PPCInterpreterALU.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cafe/HW/Espresso/Interpreter/PPCInterpreterALU.hpp b/src/Cafe/HW/Espresso/Interpreter/PPCInterpreterALU.hpp index 2fe07509..5b3919d0 100644 --- a/src/Cafe/HW/Espresso/Interpreter/PPCInterpreterALU.hpp +++ b/src/Cafe/HW/Espresso/Interpreter/PPCInterpreterALU.hpp @@ -123,7 +123,7 @@ static void PPCInterpreter_ADDI(PPCInterpreter_t* hCPU, uint32 opcode) sint32 rD, rA; uint32 imm; PPC_OPC_TEMPL_D_SImm(opcode, rD, rA, imm); - hCPU->gpr[rD] = (rA ? (int)hCPU->gpr[rA] : 0) + (int)imm; + hCPU->gpr[rD] = (rA ? hCPU->gpr[rA] : 0u) + imm; PPCInterpreter_nextInstruction(hCPU); }