Skip to content

Conversation

@landrix
Copy link
Contributor

@landrix landrix commented Dec 5, 2025

Addresses an issue where direct UInt64 to Double conversion, as well as division operations involving UInt64, were failing on 32-bit ARM64 emulation.

Implements a workaround by manually converting UInt64 to Double in two parts (hi and lo Cardinal) to avoid the failing operations. This ensures correct parsing of large numbers.

More about the bug in general. It doesn't just affect the delphimvcframework.

https://en.delphipraxis.net/topic/14678-critical-bug-report-delphi-13-32-bit-rtl-failures-on-windows-arm64-emulation

Addresses an issue where direct UInt64 to Double conversion, as well as division operations involving UInt64, were failing on 32-bit ARM64 emulation.

Implements a workaround by manually converting UInt64 to Double in two parts (hi and lo Cardinal) to avoid the failing operations. This ensures correct parsing of large numbers.
Copilot AI review requested due to automatic review settings December 5, 2025 06:16
Copilot finished reviewing on behalf of landrix December 5, 2025 06:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical bug in Delphi 13's 32-bit RTL affecting Windows ARM64 emulation where UInt64 to Double conversions and division operations fail. The fix implements a workaround by manually converting UInt64 values to Double using a helper function that splits the value into high and low 32-bit components.

  • Introduces U64ToDouble helper function that safely converts UInt64 to Double by splitting into hi/lo Cardinals
  • Updates decimal digit parsing in both UTF-8 and Unicode JSON readers to use the new helper

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant