Skip to content

Commit 13fd8c5

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Eliminate checks using ZEND_CONST_COND() macro
2 parents f61f122 + 697266a commit 13fd8c5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Zend/zend_execute.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,13 +2060,13 @@ static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht
20602060
}
20612061
} else if (EXPECTED(Z_TYPE_P(dim) == IS_STRING)) {
20622062
offset_key = Z_STR_P(dim);
2063-
if (dim_type != IS_CONST) {
2063+
if (ZEND_CONST_COND(dim_type != IS_CONST, 1)) {
20642064
if (ZEND_HANDLE_NUMERIC(offset_key, hval)) {
20652065
goto num_index;
20662066
}
20672067
}
20682068
str_index:
2069-
retval = zend_hash_find_ex(ht, offset_key, dim_type == IS_CONST);
2069+
retval = zend_hash_find_ex(ht, offset_key, ZEND_CONST_COND(dim_type == IS_CONST, 0));
20702070
if (retval) {
20712071
/* support for $GLOBALS[...] */
20722072
if (UNEXPECTED(Z_TYPE_P(retval) == IS_INDIRECT)) {
@@ -2201,7 +2201,7 @@ static zend_always_inline void zend_fetch_dimension_address(zval *result, zval *
22012201
}
22022202
ZVAL_ERROR(result);
22032203
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
2204-
if (/*dim_type == IS_CV &&*/ dim && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
2204+
if (ZEND_CONST_COND(dim_type == IS_CV, dim != NULL) && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
22052205
dim = ZVAL_UNDEFINED_OP2();
22062206
}
22072207
if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) {
@@ -2244,7 +2244,7 @@ static zend_always_inline void zend_fetch_dimension_address(zval *result, zval *
22442244
} else {
22452245
return_null:
22462246
/* for read-mode only */
2247-
if (/*dim_type == IS_CV &&*/ dim && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
2247+
if (ZEND_CONST_COND(dim_type == IS_CV, dim != NULL) && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
22482248
ZVAL_UNDEFINED_OP2();
22492249
}
22502250
ZVAL_NULL(result);
@@ -2356,7 +2356,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
23562356
ZVAL_INTERNED_STR(result, ZSTR_CHAR(c));
23572357
}
23582358
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
2359-
if (/*dim_type == IS_CV &&*/ UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
2359+
if (ZEND_CONST_COND(dim_type == IS_CV, 1) && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
23602360
dim = ZVAL_UNDEFINED_OP2();
23612361
}
23622362
if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) {
@@ -2378,7 +2378,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
23782378
if (type != BP_VAR_IS && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
23792379
container = ZVAL_UNDEFINED_OP1();
23802380
}
2381-
if (/*dim_type == IS_CV &&*/ UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
2381+
if (ZEND_CONST_COND(dim_type == IS_CV, 1) && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
23822382
ZVAL_UNDEFINED_OP2();
23832383
}
23842384
if (!is_list && type != BP_VAR_IS) {

0 commit comments

Comments
 (0)