Skip to content

UPhysics.pas problem with 64b compiler #1

@omarreis

Description

@omarreis

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)^;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions