From 096399d3719769dde4004bcefec87a447fd32cf3 Mon Sep 17 00:00:00 2001 From: shuffle2 Date: Tue, 6 Jun 2017 03:49:01 -0700 Subject: [PATCH] quick UB fix for 3c0bdd74 --- Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp index 406814ac77..480ee662da 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp @@ -359,7 +359,7 @@ void Interpreter::srawx(UGeckoInstruction inst) s32 rrs = rGPR[inst.RS]; rGPR[inst.RA] = rrs >> amount; - SetCarry(rrs < 0 && (u32(rrs) << (32 - amount)) != 0); + SetCarry(rrs < 0 && amount > 0 && (u32(rrs) << (32 - amount)) != 0); } if (inst.Rc) @@ -373,7 +373,7 @@ void Interpreter::srawix(UGeckoInstruction inst) s32 rrs = rGPR[inst.RS]; rGPR[inst.RA] = rrs >> amount; - SetCarry(rrs < 0 && (u32(rrs) << (32 - amount)) != 0); + SetCarry(rrs < 0 && amount > 0 && (u32(rrs) << (32 - amount)) != 0); if (inst.Rc) Helper_UpdateCR0(rGPR[inst.RA]);