From fbff89d03b117cfa745f2875d1e9ed6bf1fb8a44 Mon Sep 17 00:00:00 2001 From: Fabio Arnold Date: Wed, 18 Mar 2026 23:05:17 +0100 Subject: [PATCH] PPC: fix UB sint overflow --- 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 5b3919d0..4b53ecfd 100644 --- a/src/Cafe/HW/Espresso/Interpreter/PPCInterpreterALU.hpp +++ b/src/Cafe/HW/Espresso/Interpreter/PPCInterpreterALU.hpp @@ -33,7 +33,7 @@ static bool checkAdditionOverflow(uint32 x, uint32 y, uint32 r) static void PPCInterpreter_ADD(PPCInterpreter_t* hCPU, uint32 opcode) { PPC_OPC_TEMPL3_XO(); - hCPU->gpr[rD] = (int)hCPU->gpr[rA] + (int)hCPU->gpr[rB]; + hCPU->gpr[rD] = hCPU->gpr[rA] + hCPU->gpr[rB]; if (opHasRC()) ppc_update_cr0(hCPU, hCPU->gpr[rD]); PPCInterpreter_nextInstruction(hCPU);