Skip to content

Commit 21e1a0d

Browse files
committed
Remove exception in Randomizer::getBytes()
Same reasoning as in the previous commit applies.
1 parent 6d8b54b commit 21e1a0d

File tree

3 files changed

+0
-11
lines changed

3 files changed

+0
-11
lines changed

ext/random/randomizer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ PHP_METHOD(Random_Randomizer, getBytes)
163163
result = randomizer->algo->generate(randomizer->status);
164164
if (EG(exception)) {
165165
zend_string_free(retval);
166-
zend_throw_exception(spl_ce_RuntimeException, "Random number generation failed", 0);
167166
RETURN_THROWS();
168167
}
169168
for (size_t i = 0; i < randomizer->status->last_generated_size; i++) {

ext/random/tests/03_randomizer/user_throws.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,4 @@ Stack trace:
2121
#0 [internal function]: Random\Engine@anonymous->generate()
2222
#1 %s(%d): Random\Randomizer->getBytes(1)
2323
#2 {main}
24-
25-
Next RuntimeException: Random number generation failed in %s:%d
26-
Stack trace:
27-
#0 %s(%d): Random\Randomizer->getBytes(1)
28-
#1 {main}
2924
thrown in %s on line %d

ext/random/tests/03_randomizer/user_unsafe.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ Stack trace:
9393
#0 %s(%d): Random\Randomizer->getBytes(1)
9494
#1 {main}
9595

96-
Next RuntimeException: Random number generation failed in %s:%d
97-
Stack trace:
98-
#0 %s(%d): Random\Randomizer->getBytes(1)
99-
#1 {main}
100-
10196
-------
10297

10398
Error: A random engine must return a non-empty string in %s:%d

0 commit comments

Comments
 (0)