Skip to content

Conversation

@pmcgee69
Copy link

Solution due to Kas Ob at Delphi-Praxis : https://en.delphipraxis.net/topic/13377-overflow-checking-from-104-onwards

Current code works in 10.3.3, Unknown in 10.4.2
TRandom.Next overflows 64 bits in 11 & 12
and Range Error in NextBytes with UInt32 returned to an Integer variable (Rnd)

Current code works in 10.3.3
Unknown in 10.4.2
TRandom.Next overflows 64 bits in 11 & 12
And Range error in NextBytes with UInt32 returned to an Integer variable (Rnd)
@jimmckeeth
Copy link

This looks good, but can you provide a test case that fails on the old code and passes with the new code? If that isn't too much trouble it would be helpful.

@pmcgee69
Copy link
Author

This looks good, but can you provide a test case that fails on the old code and passes with the new code?

Tests submitted as a separate PR. ✅

@jimmckeeth jimmckeeth merged commit 922a8ed into TurboPack:main Oct 31, 2025
@jimmckeeth
Copy link

merged. sorry for the delay, thanks for the contribution.

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.

2 participants