We discovered a serious bug in the latest btAlignedObjectArray.h file. Recently the copy constructor was added to it, however it simply ignores the BT_USE_PLACEMENT_NEW settings. This results in bizarre random stack crashes.
You should simply use the copy method there, which I made const (since it is const anyhow). Less code duplication, less bugs, more fun
Patch below.
Cheers
Code: Select all
Index: C:/svn/ttdev/libs/shared/inc/bullet/LinearMath/btAlignedObjectArray.h
===================================================================
--- C:/svn/ttdev/libs/shared/inc/bullet/LinearMath/btAlignedObjectArray.h (revision 2960)
+++ C:/svn/ttdev/libs/shared/inc/bullet/LinearMath/btAlignedObjectArray.h (revision 2961)
@@ -58,7 +58,7 @@
{
return (size ? size*2 : 1);
}
- SIMD_FORCE_INLINE void copy(int start,int end, T* dest)
+ SIMD_FORCE_INLINE void copy(int start,int end, T* dest) const
{
int i;
for (i=start;i<end;++i)
@@ -123,14 +123,9 @@
btAlignedObjectArray(const btAlignedObjectArray& otherArray)
{
init();
-
int otherSize = otherArray.size();
resize (otherSize);
- int i;
- for (i=0;i<otherSize;i++)
- {
- m_data[i] = otherArray[i];
- }
+ otherArray.copy(0, otherSize, m_data);
}
SIMD_FORCE_INLINE int capacity() const