Skip to content

Commit 5f93ba2

Browse files
committed
More fixes for UBs in Bullet
llvm-svn: 343219
1 parent 40bf4a3 commit 5f93ba2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MultiSource/Benchmarks/Bullet/include/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class btHashedOverlappingPairCache : public btOverlappingPairCache
195195
// This assumes proxyId1 and proxyId2 are 16-bit.
196196
SIMD_FORCE_INLINE int getHash(int proxyId1, int proxyId2)
197197
{
198-
int key = (proxyId2 << 16) | proxyId1;
198+
unsigned int key = (proxyId2 << 16) | proxyId1;
199199
key = ~key + (key << 15);
200200
key = key ^ (key >> 12);
201201
key = key + (key << 2);
@@ -210,7 +210,7 @@ class btHashedOverlappingPairCache : public btOverlappingPairCache
210210

211211
SIMD_FORCE_INLINE unsigned int getHash(unsigned int proxyId1, unsigned int proxyId2)
212212
{
213-
int key = static_cast<int>(((unsigned int)proxyId1) | (((unsigned int)proxyId2) <<16));
213+
unsigned int key = static_cast<int>(((unsigned int)proxyId1) | (((unsigned int)proxyId2) <<16));
214214
// Thomas Wang's hash
215215

216216
key += ~(key << 15);

0 commit comments

Comments
 (0)