mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix rand_range32() for umax = UINT32_MAX (#9416)
* Fix rand_range32() for umax = UINT32_MAX
This was introduced in the commit that added the random extension:
4d8dd8d258
.
Resolves GH-9415
* [ci skip] Rename `$r` to `$randomizer` in gh9415.phpt
* Make gh9415.phpt deterministic
* Make gh9415.phpt compatible with 32-bit
This commit is contained in:
parent
b78c087b32
commit
0f696e2934
3 changed files with 24 additions and 1 deletions
|
@ -107,7 +107,7 @@ static inline uint32_t rand_range32(const php_random_algo *algo, php_random_stat
|
|||
|
||||
/* Special case where no modulus is required */
|
||||
if (UNEXPECTED(umax == UINT32_MAX)) {
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Increment the max so range is inclusive of max */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue