Skip to content

Fix rand_range32() for umax = UINT32_MAX#9416

Merged
TimWolla merged 4 commits into
php:masterfrom
TimWolla:rand-range-32
Aug 24, 2022
Merged

Fix rand_range32() for umax = UINT32_MAX#9416
TimWolla merged 4 commits into
php:masterfrom
TimWolla:rand-range-32

Conversation

@TimWolla

Copy link
Copy Markdown
Member

This was introduced in the commit that added the random extension:
4d8dd8d.

Resolves GH-9415

This was introduced in the commit that added the random extension:
4d8dd8d.

Resolves phpGH-9415

@zeriyoshi zeriyoshi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Embarrassing mistake. Thanks for the proper fix!
LGTM

@cmb69 cmb69 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! Looks good to me, except perhaps for the test case.

Comment thread ext/random/tests/03_randomizer/gh9415.phpt Outdated
@cmb69

cmb69 commented Aug 24, 2022

Copy link
Copy Markdown
Member

OT, but since I've just noticed this: we need to address https://github.com/php/php-src/runs/7992692944?check_suite_focus=true#step:5:9.

PS: #9417

@TimWolla

Copy link
Copy Markdown
Member Author

OT, but since I've just noticed this: we need to address https://github.com/php/php-src/runs/7992692944?check_suite_focus=true#step:5:9.

Yes, I noticed that also. Is this caused by an update of libxml in homebrew?

@cmb69

cmb69 commented Aug 24, 2022

Copy link
Copy Markdown
Member

Is this caused by an update of libxml in homebrew?

Apparently. xmlRelaxNGCleanupTypes() is deprecated as of libxml 2.10.0 (latest version; released just a few days ago).

@TimWolla TimWolla merged commit 0f696e2 into php:master Aug 24, 2022
@TimWolla TimWolla deleted the rand-range-32 branch August 24, 2022 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Randomizer::getInt(0, 2**32 - 1) with Mt19937 always returns 1

3 participants