initialize values (padding etc) help asan/msan tests
This commit is contained in:
@@ -437,6 +437,9 @@ const char* btBvhTriangleMeshShape::serialize(void* dataBuffer, btSerializer* se
|
||||
trimeshData->m_triangleInfoMap = 0;
|
||||
}
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
memset(trimeshData->m_pad3, 0, sizeof(trimeshData->m_pad3));
|
||||
|
||||
return "btTriangleMeshShapeData";
|
||||
}
|
||||
|
||||
|
||||
@@ -164,11 +164,17 @@ SIMD_FORCE_INLINE int btCapsuleShape::calculateSerializeBufferSize() const
|
||||
SIMD_FORCE_INLINE const char* btCapsuleShape::serialize(void* dataBuffer, btSerializer* serializer) const
|
||||
{
|
||||
btCapsuleShapeData* shapeData = (btCapsuleShapeData*) dataBuffer;
|
||||
|
||||
|
||||
btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData,serializer);
|
||||
|
||||
shapeData->m_upAxis = m_upAxis;
|
||||
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
shapeData->m_padding[0] = 0;
|
||||
shapeData->m_padding[1] = 0;
|
||||
shapeData->m_padding[2] = 0;
|
||||
shapeData->m_padding[3] = 0;
|
||||
|
||||
return "btCapsuleShapeData";
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,10 @@ const char* btCollisionShape::serialize(void* dataBuffer, btSerializer* serializ
|
||||
serializer->serializeName(name);
|
||||
}
|
||||
shapeData->m_shapeType = m_shapeType;
|
||||
//shapeData->m_padding//??
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
memset(shapeData->m_padding, 0, sizeof(shapeData->m_padding));
|
||||
|
||||
return "btCollisionShapeData";
|
||||
}
|
||||
|
||||
|
||||
@@ -168,11 +168,17 @@ SIMD_FORCE_INLINE int btConeShape::calculateSerializeBufferSize() const
|
||||
SIMD_FORCE_INLINE const char* btConeShape::serialize(void* dataBuffer, btSerializer* serializer) const
|
||||
{
|
||||
btConeShapeData* shapeData = (btConeShapeData*) dataBuffer;
|
||||
|
||||
|
||||
btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData,serializer);
|
||||
|
||||
|
||||
shapeData->m_upIndex = m_coneIndices[1];
|
||||
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
shapeData->m_padding[0] = 0;
|
||||
shapeData->m_padding[1] = 0;
|
||||
shapeData->m_padding[2] = 0;
|
||||
shapeData->m_padding[3] = 0;
|
||||
|
||||
return "btConeShapeData";
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,10 @@ const char* btConvexHullShape::serialize(void* dataBuffer, btSerializer* seriali
|
||||
}
|
||||
serializer->finalizeChunk(chunk,btVector3DataName,BT_ARRAY_CODE,(void*)&m_unscaledPoints[0]);
|
||||
}
|
||||
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
memset(shapeData->m_padding3, 0, sizeof(shapeData->m_padding3));
|
||||
|
||||
return "btConvexHullShapeData";
|
||||
}
|
||||
|
||||
|
||||
@@ -172,6 +172,9 @@ SIMD_FORCE_INLINE const char* btConvexInternalShape::serialize(void* dataBuffer,
|
||||
m_localScaling.serializeFloat(shapeData->m_localScaling);
|
||||
shapeData->m_collisionMargin = float(m_collisionMargin);
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
shapeData->m_padding = 0;
|
||||
|
||||
return "btConvexInternalShapeData";
|
||||
}
|
||||
|
||||
|
||||
@@ -199,11 +199,17 @@ SIMD_FORCE_INLINE int btCylinderShape::calculateSerializeBufferSize() const
|
||||
SIMD_FORCE_INLINE const char* btCylinderShape::serialize(void* dataBuffer, btSerializer* serializer) const
|
||||
{
|
||||
btCylinderShapeData* shapeData = (btCylinderShapeData*) dataBuffer;
|
||||
|
||||
|
||||
btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData,serializer);
|
||||
|
||||
shapeData->m_upAxis = m_upAxis;
|
||||
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
shapeData->m_padding[0] = 0;
|
||||
shapeData->m_padding[1] = 0;
|
||||
shapeData->m_padding[2] = 0;
|
||||
shapeData->m_padding[3] = 0;
|
||||
|
||||
return "btCylinderShapeData";
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,10 @@ const char* btMultiSphereShape::serialize(void* dataBuffer, btSerializer* serial
|
||||
}
|
||||
serializer->finalizeChunk(chunk,"btPositionAndRadius",BT_ARRAY_CODE,(void*)&m_localPositionArray[0]);
|
||||
}
|
||||
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
memset(shapeData->m_padding, 0, sizeof(shapeData->m_padding));
|
||||
|
||||
return "btMultiSphereShapeData";
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,13 @@ SIMD_FORCE_INLINE const char* btStaticPlaneShape::serialize(void* dataBuffer, bt
|
||||
m_localScaling.serializeFloat(planeData->m_localScaling);
|
||||
m_planeNormal.serializeFloat(planeData->m_planeNormal);
|
||||
planeData->m_planeConstant = float(m_planeConstant);
|
||||
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
planeData->m_pad[0] = 0;
|
||||
planeData->m_pad[1] = 0;
|
||||
planeData->m_pad[2] = 0;
|
||||
planeData->m_pad[3] = 0;
|
||||
|
||||
return "btStaticPlaneShapeData";
|
||||
}
|
||||
|
||||
|
||||
@@ -293,6 +293,9 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s
|
||||
tmpIndices[gfxindex].m_values[0] = tri_indices[0];
|
||||
tmpIndices[gfxindex].m_values[1] = tri_indices[1];
|
||||
tmpIndices[gfxindex].m_values[2] = tri_indices[2];
|
||||
// Fill padding with zeros to appease msan.
|
||||
tmpIndices[gfxindex].m_pad[0] = 0;
|
||||
tmpIndices[gfxindex].m_pad[1] = 0;
|
||||
}
|
||||
serializer->finalizeChunk(chunk,"btShortIntIndexTripletData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
|
||||
}
|
||||
@@ -311,6 +314,8 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s
|
||||
tmpIndices[gfxindex].m_values[0] = tri_indices[0];
|
||||
tmpIndices[gfxindex].m_values[1] = tri_indices[1];
|
||||
tmpIndices[gfxindex].m_values[2] = tri_indices[2];
|
||||
// Fill padding with zeros to appease msan.
|
||||
tmpIndices[gfxindex].m_pad = 0;
|
||||
}
|
||||
serializer->finalizeChunk(chunk,"btCharIndexTripletData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
|
||||
}
|
||||
@@ -375,6 +380,8 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s
|
||||
serializer->finalizeChunk(chunk,"btMeshPartData",BT_ARRAY_CODE,chunk->m_oldPtr);
|
||||
}
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
memset(trimeshData->m_padding, 0, sizeof(trimeshData->m_padding));
|
||||
|
||||
m_scaling.serializeFloat(trimeshData->m_scaling);
|
||||
return "btStridingMeshInterfaceData";
|
||||
|
||||
@@ -195,6 +195,13 @@ SIMD_FORCE_INLINE const char* btTriangleInfoMap::serialize(void* dataBuffer, btS
|
||||
serializer->finalizeChunk(chunk,"int",BT_ARRAY_CODE,(void*) &m_keyArray[0]);
|
||||
|
||||
}
|
||||
|
||||
// Fill padding with zeros to appease msan.
|
||||
tmapData->m_padding[0] = 0;
|
||||
tmapData->m_padding[1] = 0;
|
||||
tmapData->m_padding[2] = 0;
|
||||
tmapData->m_padding[3] = 0;
|
||||
|
||||
return "btTriangleInfoMapData";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user