initialize values (padding etc) help asan/msan tests

This commit is contained in:
Erwin Coumans
2017-05-09 18:00:28 -07:00
parent 7da4a362e1
commit fc6fb7b14c
19 changed files with 109 additions and 14 deletions

View File

@@ -141,6 +141,14 @@ SIMD_FORCE_INLINE const char* btGearConstraint::serialize(void* dataBuffer, btSe
gear->m_ratio = m_ratio;
// Fill padding with zeros to appease msan.
#ifndef BT_USE_DOUBLE_PRECISION
gear->m_padding[0] = 0;
gear->m_padding[1] = 0;
gear->m_padding[2] = 0;
gear->m_padding[3] = 0;
#endif
return btGearConstraintDataName;
}

View File

@@ -664,6 +664,11 @@ SIMD_FORCE_INLINE const char* btGeneric6DofSpring2Constraint::serialize(void* da
dof->m_rotateOrder = m_rotateOrder;
dof->m_padding1[0] = 0;
dof->m_padding1[1] = 0;
dof->m_padding1[2] = 0;
dof->m_padding1[3] = 0;
return btGeneric6DofSpring2ConstraintDataName;
}

View File

@@ -489,6 +489,14 @@ SIMD_FORCE_INLINE const char* btHingeConstraint::serialize(void* dataBuffer, btS
hingeData->m_relaxationFactor = float(m_relaxationFactor);
#endif
// Fill padding with zeros to appease msan.
#ifdef BT_USE_DOUBLE_PRECISION
hingeData->m_padding1[0] = 0;
hingeData->m_padding1[1] = 0;
hingeData->m_padding1[2] = 0;
hingeData->m_padding1[3] = 0;
#endif
return btHingeConstraintDataName;
}