Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Random.Next(int, int) on 64-bit when max-min overflows int.MaxValue #50922

Merged
merged 2 commits into from
Apr 11, 2021

Conversation

stephentoub
Copy link
Member

The fix is a missing cast. Everything else is asserts and test changes.

Fixes #50911

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

The fix is a missing cast.  Everything else is asserts and test changes.
@ghost
Copy link

ghost commented Apr 11, 2021

Hello @danmoseley!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@stephentoub stephentoub merged commit ee32ee2 into dotnet:main Apr 11, 2021
@stephentoub stephentoub deleted the randomnextoverflow branch April 11, 2021 02:59
@ghost ghost locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Random.Next(int,int) can return out-of-bounds result in .NET 6 Preview 2
3 participants