Skip to content

PcgOneseq128XslRr64::jump(): Throw ValueError for negative $advance#9213

Merged
Girgias merged 4 commits into
php:masterfrom
sandfoxme:pcg64-nonnegative-advance
Aug 1, 2022
Merged

PcgOneseq128XslRr64::jump(): Throw ValueError for negative $advance#9213
Girgias merged 4 commits into
php:masterfrom
sandfoxme:pcg64-nonnegative-advance

Conversation

@arokettu

Copy link
Copy Markdown
Contributor

Fixes #9212

@TimWolla TimWolla 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 for the patch! Can you add a test, similar to https://github.com/php/php-src/blob/master/ext/random/tests/02_engine/mt19937_error.phpt? pcgoneseq128xslrr64_jump_error.phpt should be an appropriate name.

Comment thread ext/random/engine_pcgoneseq128xslrr64.c
@arokettu

arokettu commented Aug 1, 2022

Copy link
Copy Markdown
Contributor Author

Thank you for the patch! Can you add a test, similar to https://github.com/php/php-src/blob/master/ext/random/tests/02_engine/mt19937_error.phpt? pcgoneseq128xslrr64_jump_error.phpt should be an appropriate name.

done

@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.

It looks good. Thanks.
I was neglecting to take this into consideration.

Comment thread ext/random/tests/02_engine/pcgoneseq128xslrr64_jump_error.phpt
@TimWolla TimWolla self-assigned this Aug 1, 2022
@Girgias Girgias merged commit 50bd8ba into php:master Aug 1, 2022
@arokettu arokettu deleted the pcg64-nonnegative-advance branch August 1, 2022 13:34
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.

PcgOneseq128XslRr64::jump() should not allow negative $advance

5 participants