[test-suite] r343219 - More fixes for UBs in Bullet
Anton Korobeynikov via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 27 07:09:32 PDT 2018
Author: asl
Date: Thu Sep 27 07:09:32 2018
New Revision: 343219
URL: http://llvm.org/viewvc/llvm-project?rev=343219&view=rev
Log:
More fixes for UBs in Bullet
Modified:
test-suite/trunk/MultiSource/Benchmarks/Bullet/include/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
Modified: test-suite/trunk/MultiSource/Benchmarks/Bullet/include/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Bullet/include/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h?rev=343219&r1=343218&r2=343219&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Bullet/include/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Bullet/include/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h Thu Sep 27 07:09:32 2018
@@ -195,7 +195,7 @@ private:
// This assumes proxyId1 and proxyId2 are 16-bit.
SIMD_FORCE_INLINE int getHash(int proxyId1, int proxyId2)
{
- int key = (proxyId2 << 16) | proxyId1;
+ unsigned int key = (proxyId2 << 16) | proxyId1;
key = ~key + (key << 15);
key = key ^ (key >> 12);
key = key + (key << 2);
@@ -210,7 +210,7 @@ private:
SIMD_FORCE_INLINE unsigned int getHash(unsigned int proxyId1, unsigned int proxyId2)
{
- int key = static_cast<int>(((unsigned int)proxyId1) | (((unsigned int)proxyId2) <<16));
+ unsigned int key = static_cast<int>(((unsigned int)proxyId1) | (((unsigned int)proxyId2) <<16));
// Thomas Wang's hash
key += ~(key << 15);
More information about the llvm-commits
mailing list