@@ -81,7 +81,7 @@ PHP_METHOD(Random_Randomizer, __construct)
81
81
82
82
OBJ_RELEASE (Z_OBJ_P (& engine ));
83
83
84
- if (EG (exception )) {
84
+ if (UNEXPECTED ( EG (exception ) )) {
85
85
RETURN_THROWS ();
86
86
}
87
87
@@ -104,7 +104,7 @@ PHP_METHOD(Random_Randomizer, nextFloat)
104
104
php_random_result r = randomizer -> algo -> generate (randomizer -> status );
105
105
result = result | (r .result << (total_size * 8 ));
106
106
total_size += r .size ;
107
- if (EG (exception )) {
107
+ if (UNEXPECTED ( EG (exception ) )) {
108
108
RETURN_THROWS ();
109
109
}
110
110
} while (total_size < sizeof (uint64_t ));
@@ -212,7 +212,7 @@ PHP_METHOD(Random_Randomizer, nextInt)
212
212
ZEND_PARSE_PARAMETERS_NONE ();
213
213
214
214
php_random_result result = randomizer -> algo -> generate (randomizer -> status );
215
- if (EG (exception )) {
215
+ if (UNEXPECTED ( EG (exception ) )) {
216
216
RETURN_THROWS ();
217
217
}
218
218
if (result .size > sizeof (zend_long )) {
@@ -257,7 +257,7 @@ PHP_METHOD(Random_Randomizer, getInt)
257
257
result = randomizer -> algo -> range (randomizer -> status , min , max );
258
258
}
259
259
260
- if (EG (exception )) {
260
+ if (UNEXPECTED ( EG (exception ) )) {
261
261
RETURN_THROWS ();
262
262
}
263
263
@@ -286,7 +286,7 @@ PHP_METHOD(Random_Randomizer, getBytes)
286
286
287
287
while (total_size < length ) {
288
288
php_random_result result = randomizer -> algo -> generate (randomizer -> status );
289
- if (EG (exception )) {
289
+ if (UNEXPECTED ( EG (exception ) )) {
290
290
zend_string_free (retval );
291
291
RETURN_THROWS ();
292
292
}
@@ -405,7 +405,7 @@ PHP_METHOD(Random_Randomizer, getBytesFromString)
405
405
while (total_size < length ) {
406
406
uint64_t offset = randomizer -> algo -> range (randomizer -> status , 0 , max_offset );
407
407
408
- if (EG (exception )) {
408
+ if (UNEXPECTED ( EG (exception ) )) {
409
409
zend_string_free (retval );
410
410
RETURN_THROWS ();
411
411
}
@@ -425,7 +425,7 @@ PHP_METHOD(Random_Randomizer, getBytesFromString)
425
425
int failures = 0 ;
426
426
while (total_size < length ) {
427
427
php_random_result result = randomizer -> algo -> generate (randomizer -> status );
428
- if (EG (exception )) {
428
+ if (UNEXPECTED ( EG (exception ) )) {
429
429
zend_string_free (retval );
430
430
RETURN_THROWS ();
431
431
}
@@ -497,7 +497,7 @@ PHP_METHOD(Random_Randomizer, __unserialize)
497
497
RETURN_THROWS ();
498
498
}
499
499
object_properties_load (& randomizer -> std , Z_ARRVAL_P (members_zv ));
500
- if (EG (exception )) {
500
+ if (UNEXPECTED ( EG (exception ) )) {
501
501
zend_throw_exception (NULL , "Invalid serialization data for Random\\Randomizer object" , 0 );
502
502
RETURN_THROWS ();
503
503
}
0 commit comments