summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErwin Coumans <erwincoumans@google.com>2021-05-12 20:14:15 +0000
committerErwin Coumans <erwincoumans@google.com>2021-05-12 20:14:15 +0000
commit92fb2db0a36e5311b287d440116af3e1555bc2d5 (patch)
tree516f092620ec51431711d82a44680d328a3566ff /src
parent092b7bc3d9efcf663acee8f1155a22258c779151 (diff)
downloadbullet3-92fb2db0a36e5311b287d440116af3e1555bc2d5.tar.gz
fix some msan (memory sanitizer) issues
Diffstat (limited to 'src')
-rw-r--r--src/BulletCollision/CollisionDispatch/btManifoldResult.cpp2
-rw-r--r--src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h10
-rw-r--r--src/LinearMath/btAlignedAllocator.cpp7
3 files changed, 15 insertions, 4 deletions
diff --git a/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp b/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp
index 770eb2436..e4fe9e3e5 100644
--- a/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp
+++ b/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp
@@ -90,13 +90,11 @@ btManifoldResult::btManifoldResult(const btCollisionObjectWrapper* body0Wrap, co
: m_manifoldPtr(0),
m_body0Wrap(body0Wrap),
m_body1Wrap(body1Wrap)
-#ifdef DEBUG_PART_INDEX
,
m_partId0(-1),
m_partId1(-1),
m_index0(-1),
m_index1(-1)
-#endif //DEBUG_PART_INDEX
,
m_closestPointDistanceThreshold(0)
{
diff --git a/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h b/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
index 573fc86bf..520a7dfb6 100644
--- a/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
+++ b/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
@@ -72,11 +72,17 @@ public:
btScalar distance) : m_localPointA(pointA),
m_localPointB(pointB),
m_normalWorldOnB(normal),
+ m_positionWorldOnB(0,0,0),
+ m_positionWorldOnA(0,0,0),
m_distance1(distance),
m_combinedFriction(btScalar(0.)),
m_combinedRollingFriction(btScalar(0.)),
m_combinedSpinningFriction(btScalar(0.)),
m_combinedRestitution(btScalar(0.)),
+ m_partId0(-1),
+ m_partId1(-1),
+ m_index0(-1),
+ m_index1(-1),
m_userPersistentData(0),
m_contactPointFlags(0),
m_appliedImpulse(0.f),
@@ -88,7 +94,9 @@ public:
m_contactCFM(0.f),
m_contactERP(0.f),
m_frictionCFM(0.f),
- m_lifeTime(0)
+ m_lifeTime(0),
+ m_lateralFrictionDir1(0,0,0),
+ m_lateralFrictionDir2(0,0,0)
{
}
diff --git a/src/LinearMath/btAlignedAllocator.cpp b/src/LinearMath/btAlignedAllocator.cpp
index be8f8aa6d..a6e29a8a9 100644
--- a/src/LinearMath/btAlignedAllocator.cpp
+++ b/src/LinearMath/btAlignedAllocator.cpp
@@ -14,6 +14,7 @@ subject to the following restrictions:
*/
#include "btAlignedAllocator.h"
+#include <string.h>
#ifdef BT_DEBUG_MEMORY_ALLOCATIONS
int gNumAlignedAllocs = 0;
@@ -23,7 +24,9 @@ int gTotalBytesAlignedAllocs = 0; //detect memory leaks
static void *btAllocDefault(size_t size)
{
- return malloc(size);
+ char* data = (char*) malloc(size);
+ memset(data,0,size);//keep msan happy
+ return data;
}
static void btFreeDefault(void *ptr)
@@ -73,6 +76,8 @@ static inline void *btAlignedAllocDefault(size_t size, int alignment)
{
ret = (void *)(real);
}
+ //keep msan happy
+ memset((char*) ret, 0, size);
return (ret);
}