Fixed undefined behavior in ROR/ROL

This commit is contained in:
SChernykh
2019-02-09 01:37:43 +03:00
committed by wowario
parent 3b97d399b1
commit 4cec4db7f0
+2 -2
View File
@@ -106,13 +106,13 @@ static FORCEINLINE void v4_random_math(const struct V4_Instruction* code, v4_reg
case ROR: \
{ \
const uint32_t shift = src % REG_BITS; \
*dst = (*dst >> shift) | (*dst << (REG_BITS - shift)); \
*dst = (*dst >> shift) | (*dst << ((REG_BITS - shift) % REG_BITS)); \
} \
break; \
case ROL: \
{ \
const uint32_t shift = src % REG_BITS; \
*dst = (*dst << shift) | (*dst >> (REG_BITS - shift)); \
*dst = (*dst << shift) | (*dst >> ((REG_BITS - shift) % REG_BITS)); \
} \
break; \
case XOR: \