Skip to content

Commit 697266a

Browse files
committed
Eliminate checks using ZEND_CONST_COND() macro
1 parent 4b9ebd8 commit 697266a

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
@@ -2088,13 +2088,13 @@ static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht
20882088
}
20892089
} else if (EXPECTED(Z_TYPE_P(dim) == IS_STRING)) {
20902090
offset_key = Z_STR_P(dim);
2091-
if (dim_type != IS_CONST) {
2091+
if (ZEND_CONST_COND(dim_type != IS_CONST, 1)) {
20922092
if (ZEND_HANDLE_NUMERIC(offset_key, hval)) {
20932093
goto num_index;
20942094
}
20952095
}
20962096
str_index:
2097-
retval = zend_hash_find_ex(ht, offset_key, dim_type == IS_CONST);
2097+
retval = zend_hash_find_ex(ht, offset_key, ZEND_CONST_COND(dim_type == IS_CONST, 0));
20982098
if (retval) {
20992099
/* support for $GLOBALS[...] */
21002100
if (UNEXPECTED(Z_TYPE_P(retval) == IS_INDIRECT)) {
@@ -2229,7 +2229,7 @@ static zend_always_inline void zend_fetch_dimension_address(zval *result, zval *
22292229
}
22302230
ZVAL_ERROR(result);
22312231
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
2232-
if (/*dim_type == IS_CV &&*/ dim && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
2232+
if (ZEND_CONST_COND(dim_type == IS_CV, dim != NULL) && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
22332233
dim = ZVAL_UNDEFINED_OP2();
22342234
}
22352235
if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) {
@@ -2272,7 +2272,7 @@ static zend_always_inline void zend_fetch_dimension_address(zval *result, zval *
22722272
} else {
22732273
return_null:
22742274
/* for read-mode only */
2275-
if (/*dim_type == IS_CV &&*/ dim && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
2275+
if (ZEND_CONST_COND(dim_type == IS_CV, dim != NULL) && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
22762276
ZVAL_UNDEFINED_OP2();
22772277
}
22782278
ZVAL_NULL(result);
@@ -2384,7 +2384,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
23842384
ZVAL_INTERNED_STR(result, ZSTR_CHAR(c));
23852385
}
23862386
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
2387-
if (/*dim_type == IS_CV &&*/ UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
2387+
if (ZEND_CONST_COND(dim_type == IS_CV, 1) && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
23882388
dim = ZVAL_UNDEFINED_OP2();
23892389
}
23902390
if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) {
@@ -2406,7 +2406,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
24062406
if (type != BP_VAR_IS && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
24072407
container = ZVAL_UNDEFINED_OP1();
24082408
}
2409-
if (/*dim_type == IS_CV &&*/ UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
2409+
if (ZEND_CONST_COND(dim_type == IS_CV, 1) && UNEXPECTED(Z_TYPE_P(dim) == IS_UNDEF)) {
24102410
ZVAL_UNDEFINED_OP2();
24112411
}
24122412
if (!is_list && type != BP_VAR_IS) {

0 commit comments

Comments
 (0)