summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoloader <noloader@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2015-07-14 00:29:11 +0000
committernoloader <noloader@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2015-07-14 00:29:11 +0000
commit22a3c574c278f6d4b861e7506b73240aa2829d01 (patch)
tree221d4a0f4d04d433929db23274bf86735fd7cde9
parent72b797a072722775a0fd75f7dfa1d3d2f5da0a42 (diff)
downloadcryptopp-22a3c574c278f6d4b861e7506b73240aa2829d01.tar.gz
Cleared UBSan warnings reported by Jonathan Wakely. Cleared many issues reported in GitHub Issue 4 (its a rollup of -fsanitize=undefined)
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@581 57ff6487-cd31-0410-9ec3-f628ee90f5f0
-rw-r--r--misc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc.h b/misc.h
index 9b25ee5..357da07 100644
--- a/misc.h
+++ b/misc.h
@@ -632,13 +632,13 @@ template <class T> inline T rotrVariable(T x, unsigned int y)
template <class T> inline T rotlMod(T x, unsigned int y)
{
y %= sizeof(T)*8;
- return T((x<<y) | (x>>(sizeof(T)*8-y)));
+ return T((x<<y) | (x>>((sizeof(T)*8-y) % (sizeof(T)*8))));
}
template <class T> inline T rotrMod(T x, unsigned int y)
{
y %= sizeof(T)*8;
- return T((x>>y) | (x<<(sizeof(T)*8-y)));
+ return T((x>>y) | (x<<((sizeof(T)*8-y) % (sizeof(T)*8))));
}
#ifdef _MSC_VER