JitArm64: srawix - Fix undefined behavior

Signed bitwise left shift invokes UB when shifting a negative value.
This commit is contained in:
Sintendo 2020-12-21 11:05:22 +01:00
parent 97eb616719
commit 567357e12d
1 changed files with 1 additions and 4 deletions

View File

@ -631,10 +631,7 @@ void JitArm64::srawix(UGeckoInstruction inst)
s32 imm = (s32)gpr.GetImm(s); s32 imm = (s32)gpr.GetImm(s);
gpr.SetImmediate(a, imm >> amount); gpr.SetImmediate(a, imm >> amount);
if (amount != 0 && (imm < 0) && (imm << (32 - amount))) ComputeCarry(amount != 0 && (imm < 0) && (u32(imm) << (32 - amount)));
ComputeCarry(true);
else
ComputeCarry(false);
if (inst.Rc) if (inst.Rc)
ComputeRC0(gpr.GetImm(a)); ComputeRC0(gpr.GetImm(a));