mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
SI_DeviceGCController: Remedy undefined behavior regarding shifts
Left shifting a negative left-hand operand is undefined behavior per section 5.8.2 of the C++11 standard.
This commit is contained in:
@ -118,7 +118,11 @@ public:
|
|||||||
virtual bool GetData(u32& _Hi, u32& _Low) override
|
virtual bool GetData(u32& _Hi, u32& _Low) override
|
||||||
{
|
{
|
||||||
CSIDevice_GCController::GetData(_Hi, _Low);
|
CSIDevice_GCController::GetData(_Hi, _Low);
|
||||||
_Hi &= ~PAD_USE_ORIGIN << 16;
|
|
||||||
|
// Unset all bits except those that represent
|
||||||
|
// A, B, X, Y, Start and the error bits, as they
|
||||||
|
// are not used.
|
||||||
|
_Hi &= ~0x20FFFFFF;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user