@@ -667,17 +667,17 @@ static inline void zend_assign_to_object(zval *retval, zval *object_ptr, zval *p
667
667
zval * object = object_ptr ;
668
668
669
669
ZVAL_DEREF (object );
670
- if (Z_TYPE_P (object ) != IS_OBJECT ) {
671
- if (object == & EG (error_zval )) {
670
+ if (UNEXPECTED ( Z_TYPE_P (object ) != IS_OBJECT ) ) {
671
+ if (UNEXPECTED ( object == & EG (error_zval ) )) {
672
672
if (retval ) {
673
673
ZVAL_NULL (retval );
674
674
}
675
675
FREE_OP (free_value );
676
676
return ;
677
677
}
678
- if (Z_TYPE_P (object ) == IS_NULL ||
678
+ if (EXPECTED ( Z_TYPE_P (object ) == IS_NULL ||
679
679
Z_TYPE_P (object ) == IS_FALSE ||
680
- (Z_TYPE_P (object ) == IS_STRING && Z_STRLEN_P (object ) == 0 )) {
680
+ (Z_TYPE_P (object ) == IS_STRING && Z_STRLEN_P (object ) == 0 ))) {
681
681
zend_object * obj ;
682
682
683
683
zval_ptr_dtor (object );
@@ -1021,7 +1021,7 @@ static zend_always_inline zval *zend_fetch_dimension_address(zval *result, zval
1021
1021
fetch_from_array :
1022
1022
if (dim == NULL ) {
1023
1023
retval = zend_hash_next_index_insert (Z_ARRVAL_P (container ), & EG (uninitialized_zval ));
1024
- if (retval == NULL ) {
1024
+ if (UNEXPECTED ( retval == NULL ) ) {
1025
1025
zend_error (E_WARNING , "Cannot add element to the array as the next element is already occupied" );
1026
1026
retval = & EG (error_zval );
1027
1027
}
@@ -1100,7 +1100,7 @@ static zend_always_inline zval *zend_fetch_dimension_address(zval *result, zval
1100
1100
1101
1101
ZVAL_NULL (result );
1102
1102
zend_error (E_NOTICE , "Indirect modification of overloaded element of %s has no effect" , ce -> name -> val );
1103
- } else if (retval && Z_TYPE_P (retval ) != IS_UNDEF ) {
1103
+ } else if (EXPECTED ( retval && Z_TYPE_P (retval ) != IS_UNDEF ) ) {
1104
1104
if (!Z_ISREF_P (retval )) {
1105
1105
if (Z_REFCOUNTED_P (retval ) &&
1106
1106
Z_REFCOUNT_P (retval ) > 1 ) {
@@ -1132,7 +1132,7 @@ static zend_always_inline zval *zend_fetch_dimension_address(zval *result, zval
1132
1132
}
1133
1133
}
1134
1134
} else if (EXPECTED (Z_TYPE_P (container ) == IS_NULL )) {
1135
- if (container == & EG (error_zval )) {
1135
+ if (UNEXPECTED ( container == & EG (error_zval ) )) {
1136
1136
ZVAL_INDIRECT (result , & EG (error_zval ));
1137
1137
} else if (type != BP_VAR_UNSET ) {
1138
1138
goto convert_to_array ;
@@ -1276,15 +1276,15 @@ static void zend_fetch_property_address(zval *result, zval *container_ptr, zval
1276
1276
zval * container = container_ptr ;
1277
1277
1278
1278
ZVAL_DEREF (container );
1279
- if (Z_TYPE_P (container ) != IS_OBJECT ) {
1280
- if (container == & EG (error_zval )) {
1279
+ if (UNEXPECTED ( Z_TYPE_P (container ) != IS_OBJECT ) ) {
1280
+ if (UNEXPECTED ( container == & EG (error_zval ) )) {
1281
1281
ZVAL_INDIRECT (result , & EG (error_zval ));
1282
1282
return ;
1283
1283
}
1284
1284
1285
1285
/* this should modify object only if it's empty */
1286
1286
if (type != BP_VAR_UNSET &&
1287
- ((Z_TYPE_P (container ) == IS_NULL ||
1287
+ EXPECTED ((Z_TYPE_P (container ) == IS_NULL ||
1288
1288
Z_TYPE_P (container ) == IS_FALSE ||
1289
1289
(Z_TYPE_P (container ) == IS_STRING && Z_STRLEN_P (container )== 0 )))) {
1290
1290
zval_ptr_dtor_nogc (container );
@@ -1296,7 +1296,7 @@ static void zend_fetch_property_address(zval *result, zval *container_ptr, zval
1296
1296
}
1297
1297
}
1298
1298
1299
- if (Z_OBJ_HT_P (container )-> get_property_ptr_ptr ) {
1299
+ if (EXPECTED ( Z_OBJ_HT_P (container )-> get_property_ptr_ptr ) ) {
1300
1300
zval * ptr = Z_OBJ_HT_P (container )-> get_property_ptr_ptr (container , prop_ptr , type , cache_slot TSRMLS_CC );
1301
1301
if (NULL == ptr ) {
1302
1302
if (Z_OBJ_HT_P (container )-> read_property &&
@@ -1322,7 +1322,7 @@ static void zend_fetch_property_address(zval *result, zval *container_ptr, zval
1322
1322
ZVAL_INDIRECT (result , ptr );
1323
1323
}
1324
1324
}
1325
- } else if (Z_OBJ_HT_P (container )-> read_property ) {
1325
+ } else if (EXPECTED ( Z_OBJ_HT_P (container )-> read_property ) ) {
1326
1326
zval * ptr = Z_OBJ_HT_P (container )-> read_property (container , prop_ptr , type , cache_slot , result TSRMLS_CC );
1327
1327
if (ptr != result ) {
1328
1328
if (is_ref && ptr != & EG (uninitialized_zval )) {
0 commit comments