box2d-firemonkey
box2d-firemonkey copied to clipboard
UPhysics.pas problem with 64b compiler
In UPhysics.pas there are two pointer arithmetic problems with 64 bit compilers. The code is typecasting a pointer as an Integer. A pointer is really a NativeUInt.
// PInt32( Integer(m_stack) + SizeOf(Int32) * m_count)^ := element; //wrong // Integer(m_stack) truncates m_stack pointer, causing invalid access. PInt32( NativeUInt(m_stack) + SizeOf(Int32) * m_count)^ := element; //correct
and also
//Result := PInt32(Integer(m_stack) + SizeOf(Int32) * m_count)^; Result := PInt32(NativeUInt(m_stack) + SizeOf(Int32) * m_count)^;