diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h index 0c323f51d4..3c9ed887b3 100644 --- a/Source/Core/Common/Src/Common.h +++ b/Source/Core/Common/Src/Common.h @@ -131,10 +131,14 @@ extern "C" { #if !defined(_WIN32) inline u32 _rotl(u32 x, int shift) { + shift &= 31; + if (!shift) return x; return (x << shift) | (x >> (32 - shift)); } inline u32 _rotr(u32 x, int shift) { + shift &= 31; + if (!shift) return x; return (x >> shift) | (x << (32 - shift)); }