mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 07:45:33 +01:00
Merge pull request #9346 from Sintendo/jitarm64ub
JitArm64: Fix signed bitwise left shift UB
This commit is contained in:
commit
dcc313fd96
@ -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));
|
||||||
@ -1353,7 +1350,7 @@ void JitArm64::srawx(UGeckoInstruction inst)
|
|||||||
{
|
{
|
||||||
amount &= 0x1F;
|
amount &= 0x1F;
|
||||||
gpr.SetImmediate(a, i >> amount);
|
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)
|
if (inst.Rc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user