mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
JitArm64: srawix - Fix undefined behavior
Signed bitwise left shift invokes UB when shifting a negative value.
This commit is contained in:
@ -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));
|
||||||
|
Reference in New Issue
Block a user