Merge pull request #9346 from Sintendo/jitarm64ub

JitArm64: Fix signed bitwise left shift UB
This commit is contained in:
Léo Lam 2020-12-26 11:56:33 +01:00 committed by GitHub
commit dcc313fd96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

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