From: Dmitry Stogov Date: Tue, 20 Feb 2018 11:42:53 +0000 (+0300) Subject: Separate cold paths of ISSET_ISEMPTY_DIM_OBJ X-Git-Tag: php-7.3.0alpha1~327 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbf2d91911d6c90b06d7ec1c8d8b5c18182c7ffa;p=php Separate cold paths of ISSET_ISEMPTY_DIM_OBJ --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index d170a3d382..ee653c9029 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2019,6 +2019,125 @@ ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *di } } +static zend_never_inline zval* ZEND_FASTCALL zend_find_array_dim_slow(HashTable *ht, zval *offset EXECUTE_DATA_DC) +{ + zend_ulong hval; + + if (Z_TYPE_P(offset) == IS_DOUBLE) { + hval = zend_dval_to_lval(Z_DVAL_P(offset)); +num_idx: + return zend_hash_index_find(ht, hval); + } else if (Z_TYPE_P(offset) == IS_NULL) { +str_idx: + return zend_hash_find_ex_ind(ht, ZSTR_EMPTY_ALLOC(), 1); + } else if (Z_TYPE_P(offset) == IS_FALSE) { + hval = 0; + goto num_idx; + } else if (Z_TYPE_P(offset) == IS_TRUE) { + hval = 1; + goto num_idx; + } else if (Z_TYPE_P(offset) == IS_RESOURCE) { + hval = Z_RES_HANDLE_P(offset); + goto num_idx; + } else if (/*OP2_TYPE == IS_CV &&*/ Z_TYPE_P(offset) == IS_UNDEF) { + zval_undefined_cv(EX(opline)->op2.var EXECUTE_DATA_CC); + goto str_idx; + } else { + zend_error(E_WARNING, "Illegal offset type in isset or empty"); + return NULL; + } +} + +static zend_never_inline int ZEND_FASTCALL zend_isset_dim_slow(zval *container, zval *offset EXECUTE_DATA_DC) +{ + if (/*OP2_TYPE == IS_CV &&*/ UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { + zval_undefined_cv(EX(opline)->op2.var EXECUTE_DATA_CC); + offset = &EG(uninitialized_zval); + } + + if (/*OP1_TYPE != IS_CONST &&*/ EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { + return Z_OBJ_HT_P(container)->has_dimension(container, offset, 0); + } else { + zend_error(E_NOTICE, "Trying to check element of non-array"); + return 0; + } + } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ + zend_long lval; + + if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + lval = Z_LVAL_P(offset); +str_offset: + if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ + lval += (zend_long)Z_STRLEN_P(container); + } + if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { + return 1; + } else { + return 0; + } + } else { + /*if (OP2_TYPE & (IS_CV|IS_VAR)) {*/ + ZVAL_DEREF(offset); + /*}*/ + if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ + || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { + lval = zval_get_long(offset); + goto str_offset; + } + return 0; + } + } else { + return 0; + } +} + +static zend_never_inline int ZEND_FASTCALL zend_isempty_dim_slow(zval *container, zval *offset EXECUTE_DATA_DC) +{ + if (/*OP2_TYPE == IS_CV &&*/ UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { + zval_undefined_cv(EX(opline)->op2.var EXECUTE_DATA_CC); + offset = &EG(uninitialized_zval); + } + + if (/*OP1_TYPE != IS_CONST &&*/ EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { + return !Z_OBJ_HT_P(container)->has_dimension(container, offset, 1); + } else { + zend_error(E_NOTICE, "Trying to check element of non-array"); + return 1; + } + } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ + zend_long lval; + + if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { + lval = Z_LVAL_P(offset); +str_offset: + if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ + lval += (zend_long)Z_STRLEN_P(container); + } + if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { + return (Z_STRVAL_P(container)[lval] == '0'); + } else { + return 1; + } + } else { + /*if (OP2_TYPE & (IS_CV|IS_VAR)) {*/ + ZVAL_DEREF(offset); + /*}*/ + if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ + || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ + && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { + lval = zval_get_long(offset); + goto str_offset; + } + return 1; + } + } else { + return 1; + } +} + static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type) { if (container_op_type != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index a838dd0668..83d46863be 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -6447,7 +6447,6 @@ ZEND_VM_C_LABEL(isset_again): ZEND_VM_C_GOTO(num_index_prop); } } -ZEND_VM_C_LABEL(str_index_prop): value = zend_hash_find_ex_ind(ht, str, OP2_TYPE == IS_CONST); } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { hval = Z_LVAL_P(offset); @@ -6456,28 +6455,8 @@ ZEND_VM_C_LABEL(num_index_prop): } else if ((OP2_TYPE & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { offset = Z_REFVAL_P(offset); ZEND_VM_C_GOTO(isset_again); - } else if (Z_TYPE_P(offset) == IS_DOUBLE) { - hval = zend_dval_to_lval(Z_DVAL_P(offset)); - ZEND_VM_C_GOTO(num_index_prop); - } else if (Z_TYPE_P(offset) == IS_NULL) { - str = ZSTR_EMPTY_ALLOC(); - ZEND_VM_C_GOTO(str_index_prop); - } else if (Z_TYPE_P(offset) == IS_FALSE) { - hval = 0; - ZEND_VM_C_GOTO(num_index_prop); - } else if (Z_TYPE_P(offset) == IS_TRUE) { - hval = 1; - ZEND_VM_C_GOTO(num_index_prop); - } else if (Z_TYPE_P(offset) == IS_RESOURCE) { - hval = Z_RES_HANDLE_P(offset); - ZEND_VM_C_GOTO(num_index_prop); - } else if (OP2_TYPE == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { - GET_OP2_UNDEF_CV(offset, BP_VAR_R); - str = ZSTR_EMPTY_ALLOC(); - ZEND_VM_C_GOTO(str_index_prop); } else { - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - ZEND_VM_C_GOTO(isset_not_found); + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); } if (opline->extended_value & ZEND_ISSET) { @@ -6488,59 +6467,17 @@ ZEND_VM_C_LABEL(num_index_prop): result = (value == NULL || !i_zend_is_true(value)); } ZEND_VM_C_GOTO(isset_dim_obj_exit); - } else if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + } else if ((OP1_TYPE & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { container = Z_REFVAL_P(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { ZEND_VM_C_GOTO(isset_dim_obj_array); } } - if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { - offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); - } - - if ((OP1_TYPE != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - result = - ((opline->extended_value & ZEND_ISSET) == 0) ^ - Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); - } else { - zend_error(E_NOTICE, "Trying to check element of non-array"); - ZEND_VM_C_GOTO(isset_not_found); - } - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ - zend_long lval; - - if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { - lval = Z_LVAL_P(offset); -ZEND_VM_C_LABEL(isset_str_offset): - if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ - lval += (zend_long)Z_STRLEN_P(container); - } - if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { - if (opline->extended_value & ZEND_ISSET) { - result = 1; - } else { - result = (Z_STRVAL_P(container)[lval] == '0'); - } - } else { - ZEND_VM_C_GOTO(isset_not_found); - } - } else { - if (OP2_TYPE & (IS_CV|IS_VAR)) { - ZVAL_DEREF(offset); - } - if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ - && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { - lval = zval_get_long(offset); - ZEND_VM_C_GOTO(isset_str_offset); - } - ZEND_VM_C_GOTO(isset_not_found); - } + if (opline->extended_value & ZEND_ISSET) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); } else { -ZEND_VM_C_LABEL(isset_not_found): - result = ((opline->extended_value & ZEND_ISSET) == 0); + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); } ZEND_VM_C_LABEL(isset_dim_obj_exit): diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index d9f5534ed9..789c800591 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -5796,7 +5796,6 @@ isset_again: goto num_index_prop; } } -str_index_prop: value = zend_hash_find_ex_ind(ht, str, IS_CONST == IS_CONST); } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { hval = Z_LVAL_P(offset); @@ -5805,28 +5804,8 @@ num_index_prop: } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { offset = Z_REFVAL_P(offset); goto isset_again; - } else if (Z_TYPE_P(offset) == IS_DOUBLE) { - hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_NULL) { - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; - } else if (Z_TYPE_P(offset) == IS_FALSE) { - hval = 0; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_TRUE) { - hval = 1; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_RESOURCE) { - hval = Z_RES_HANDLE_P(offset); - goto num_index_prop; - } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { - GET_OP2_UNDEF_CV(offset, BP_VAR_R); - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; } else { - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - goto isset_not_found; + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); } if (opline->extended_value & ZEND_ISSET) { @@ -5837,59 +5816,17 @@ num_index_prop: result = (value == NULL || !i_zend_is_true(value)); } goto isset_dim_obj_exit; - } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { container = Z_REFVAL_P(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { goto isset_dim_obj_array; } } - if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { - offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); - } - - if ((IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - result = - ((opline->extended_value & ZEND_ISSET) == 0) ^ - Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); - } else { - zend_error(E_NOTICE, "Trying to check element of non-array"); - goto isset_not_found; - } - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ - zend_long lval; - - if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { - lval = Z_LVAL_P(offset); -isset_str_offset: - if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ - lval += (zend_long)Z_STRLEN_P(container); - } - if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { - if (opline->extended_value & ZEND_ISSET) { - result = 1; - } else { - result = (Z_STRVAL_P(container)[lval] == '0'); - } - } else { - goto isset_not_found; - } - } else { - if (IS_CONST & (IS_CV|IS_VAR)) { - ZVAL_DEREF(offset); - } - if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ - && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { - lval = zval_get_long(offset); - goto isset_str_offset; - } - goto isset_not_found; - } + if (opline->extended_value & ZEND_ISSET) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); } else { -isset_not_found: - result = ((opline->extended_value & ZEND_ISSET) == 0); + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); } isset_dim_obj_exit: @@ -7770,7 +7707,6 @@ isset_again: goto num_index_prop; } } -str_index_prop: value = zend_hash_find_ex_ind(ht, str, (IS_TMP_VAR|IS_VAR) == IS_CONST); } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { hval = Z_LVAL_P(offset); @@ -7779,28 +7715,8 @@ num_index_prop: } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { offset = Z_REFVAL_P(offset); goto isset_again; - } else if (Z_TYPE_P(offset) == IS_DOUBLE) { - hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_NULL) { - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; - } else if (Z_TYPE_P(offset) == IS_FALSE) { - hval = 0; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_TRUE) { - hval = 1; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_RESOURCE) { - hval = Z_RES_HANDLE_P(offset); - goto num_index_prop; - } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { - GET_OP2_UNDEF_CV(offset, BP_VAR_R); - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; } else { - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - goto isset_not_found; + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); } if (opline->extended_value & ZEND_ISSET) { @@ -7811,59 +7727,17 @@ num_index_prop: result = (value == NULL || !i_zend_is_true(value)); } goto isset_dim_obj_exit; - } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { container = Z_REFVAL_P(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { goto isset_dim_obj_array; } } - if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { - offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); - } - - if ((IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - result = - ((opline->extended_value & ZEND_ISSET) == 0) ^ - Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); - } else { - zend_error(E_NOTICE, "Trying to check element of non-array"); - goto isset_not_found; - } - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ - zend_long lval; - - if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { - lval = Z_LVAL_P(offset); -isset_str_offset: - if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ - lval += (zend_long)Z_STRLEN_P(container); - } - if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { - if (opline->extended_value & ZEND_ISSET) { - result = 1; - } else { - result = (Z_STRVAL_P(container)[lval] == '0'); - } - } else { - goto isset_not_found; - } - } else { - if ((IS_TMP_VAR|IS_VAR) & (IS_CV|IS_VAR)) { - ZVAL_DEREF(offset); - } - if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ - && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { - lval = zval_get_long(offset); - goto isset_str_offset; - } - goto isset_not_found; - } + if (opline->extended_value & ZEND_ISSET) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); } else { -isset_not_found: - result = ((opline->extended_value & ZEND_ISSET) == 0); + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); } isset_dim_obj_exit: @@ -11027,7 +10901,6 @@ isset_again: goto num_index_prop; } } -str_index_prop: value = zend_hash_find_ex_ind(ht, str, IS_CV == IS_CONST); } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { hval = Z_LVAL_P(offset); @@ -11036,28 +10909,8 @@ num_index_prop: } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { offset = Z_REFVAL_P(offset); goto isset_again; - } else if (Z_TYPE_P(offset) == IS_DOUBLE) { - hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_NULL) { - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; - } else if (Z_TYPE_P(offset) == IS_FALSE) { - hval = 0; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_TRUE) { - hval = 1; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_RESOURCE) { - hval = Z_RES_HANDLE_P(offset); - goto num_index_prop; - } else if (IS_CV == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { - GET_OP2_UNDEF_CV(offset, BP_VAR_R); - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; } else { - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - goto isset_not_found; + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); } if (opline->extended_value & ZEND_ISSET) { @@ -11068,59 +10921,17 @@ num_index_prop: result = (value == NULL || !i_zend_is_true(value)); } goto isset_dim_obj_exit; - } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { container = Z_REFVAL_P(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { goto isset_dim_obj_array; } } - if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { - offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); - } - - if ((IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - result = - ((opline->extended_value & ZEND_ISSET) == 0) ^ - Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); - } else { - zend_error(E_NOTICE, "Trying to check element of non-array"); - goto isset_not_found; - } - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ - zend_long lval; - - if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { - lval = Z_LVAL_P(offset); -isset_str_offset: - if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ - lval += (zend_long)Z_STRLEN_P(container); - } - if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { - if (opline->extended_value & ZEND_ISSET) { - result = 1; - } else { - result = (Z_STRVAL_P(container)[lval] == '0'); - } - } else { - goto isset_not_found; - } - } else { - if (IS_CV & (IS_CV|IS_VAR)) { - ZVAL_DEREF(offset); - } - if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ - && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { - lval = zval_get_long(offset); - goto isset_str_offset; - } - goto isset_not_found; - } + if (opline->extended_value & ZEND_ISSET) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); } else { -isset_not_found: - result = ((opline->extended_value & ZEND_ISSET) == 0); + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); } isset_dim_obj_exit: @@ -14639,7 +14450,6 @@ isset_again: goto num_index_prop; } } -str_index_prop: value = zend_hash_find_ex_ind(ht, str, IS_CONST == IS_CONST); } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { hval = Z_LVAL_P(offset); @@ -14648,28 +14458,8 @@ num_index_prop: } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { offset = Z_REFVAL_P(offset); goto isset_again; - } else if (Z_TYPE_P(offset) == IS_DOUBLE) { - hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_NULL) { - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; - } else if (Z_TYPE_P(offset) == IS_FALSE) { - hval = 0; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_TRUE) { - hval = 1; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_RESOURCE) { - hval = Z_RES_HANDLE_P(offset); - goto num_index_prop; - } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { - GET_OP2_UNDEF_CV(offset, BP_VAR_R); - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; } else { - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - goto isset_not_found; + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); } if (opline->extended_value & ZEND_ISSET) { @@ -14680,59 +14470,17 @@ num_index_prop: result = (value == NULL || !i_zend_is_true(value)); } goto isset_dim_obj_exit; - } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { container = Z_REFVAL_P(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { goto isset_dim_obj_array; } } - if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { - offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); - } - - if (((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - result = - ((opline->extended_value & ZEND_ISSET) == 0) ^ - Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); - } else { - zend_error(E_NOTICE, "Trying to check element of non-array"); - goto isset_not_found; - } - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ - zend_long lval; - - if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { - lval = Z_LVAL_P(offset); -isset_str_offset: - if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ - lval += (zend_long)Z_STRLEN_P(container); - } - if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { - if (opline->extended_value & ZEND_ISSET) { - result = 1; - } else { - result = (Z_STRVAL_P(container)[lval] == '0'); - } - } else { - goto isset_not_found; - } - } else { - if (IS_CONST & (IS_CV|IS_VAR)) { - ZVAL_DEREF(offset); - } - if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ - && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { - lval = zval_get_long(offset); - goto isset_str_offset; - } - goto isset_not_found; - } + if (opline->extended_value & ZEND_ISSET) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); } else { -isset_not_found: - result = ((opline->extended_value & ZEND_ISSET) == 0); + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); } isset_dim_obj_exit: @@ -16108,7 +15856,6 @@ isset_again: goto num_index_prop; } } -str_index_prop: value = zend_hash_find_ex_ind(ht, str, (IS_TMP_VAR|IS_VAR) == IS_CONST); } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { hval = Z_LVAL_P(offset); @@ -16117,28 +15864,8 @@ num_index_prop: } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { offset = Z_REFVAL_P(offset); goto isset_again; - } else if (Z_TYPE_P(offset) == IS_DOUBLE) { - hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_NULL) { - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; - } else if (Z_TYPE_P(offset) == IS_FALSE) { - hval = 0; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_TRUE) { - hval = 1; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_RESOURCE) { - hval = Z_RES_HANDLE_P(offset); - goto num_index_prop; - } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { - GET_OP2_UNDEF_CV(offset, BP_VAR_R); - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; } else { - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - goto isset_not_found; + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); } if (opline->extended_value & ZEND_ISSET) { @@ -16149,59 +15876,17 @@ num_index_prop: result = (value == NULL || !i_zend_is_true(value)); } goto isset_dim_obj_exit; - } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { container = Z_REFVAL_P(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { goto isset_dim_obj_array; } } - if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { - offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); - } - - if (((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - result = - ((opline->extended_value & ZEND_ISSET) == 0) ^ - Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); - } else { - zend_error(E_NOTICE, "Trying to check element of non-array"); - goto isset_not_found; - } - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ - zend_long lval; - - if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { - lval = Z_LVAL_P(offset); -isset_str_offset: - if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ - lval += (zend_long)Z_STRLEN_P(container); - } - if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { - if (opline->extended_value & ZEND_ISSET) { - result = 1; - } else { - result = (Z_STRVAL_P(container)[lval] == '0'); - } - } else { - goto isset_not_found; - } - } else { - if ((IS_TMP_VAR|IS_VAR) & (IS_CV|IS_VAR)) { - ZVAL_DEREF(offset); - } - if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ - && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { - lval = zval_get_long(offset); - goto isset_str_offset; - } - goto isset_not_found; - } + if (opline->extended_value & ZEND_ISSET) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); } else { -isset_not_found: - result = ((opline->extended_value & ZEND_ISSET) == 0); + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); } isset_dim_obj_exit: @@ -18114,7 +17799,6 @@ isset_again: goto num_index_prop; } } -str_index_prop: value = zend_hash_find_ex_ind(ht, str, IS_CV == IS_CONST); } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { hval = Z_LVAL_P(offset); @@ -18123,28 +17807,8 @@ num_index_prop: } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { offset = Z_REFVAL_P(offset); goto isset_again; - } else if (Z_TYPE_P(offset) == IS_DOUBLE) { - hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_NULL) { - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; - } else if (Z_TYPE_P(offset) == IS_FALSE) { - hval = 0; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_TRUE) { - hval = 1; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_RESOURCE) { - hval = Z_RES_HANDLE_P(offset); - goto num_index_prop; - } else if (IS_CV == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { - GET_OP2_UNDEF_CV(offset, BP_VAR_R); - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; } else { - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - goto isset_not_found; + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); } if (opline->extended_value & ZEND_ISSET) { @@ -18155,59 +17819,17 @@ num_index_prop: result = (value == NULL || !i_zend_is_true(value)); } goto isset_dim_obj_exit; - } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { container = Z_REFVAL_P(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { goto isset_dim_obj_array; } } - if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { - offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); - } - - if (((IS_TMP_VAR|IS_VAR) != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - result = - ((opline->extended_value & ZEND_ISSET) == 0) ^ - Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); - } else { - zend_error(E_NOTICE, "Trying to check element of non-array"); - goto isset_not_found; - } - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ - zend_long lval; - - if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { - lval = Z_LVAL_P(offset); -isset_str_offset: - if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ - lval += (zend_long)Z_STRLEN_P(container); - } - if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { - if (opline->extended_value & ZEND_ISSET) { - result = 1; - } else { - result = (Z_STRVAL_P(container)[lval] == '0'); - } - } else { - goto isset_not_found; - } - } else { - if (IS_CV & (IS_CV|IS_VAR)) { - ZVAL_DEREF(offset); - } - if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ - && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { - lval = zval_get_long(offset); - goto isset_str_offset; - } - goto isset_not_found; - } + if (opline->extended_value & ZEND_ISSET) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); } else { -isset_not_found: - result = ((opline->extended_value & ZEND_ISSET) == 0); + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); } isset_dim_obj_exit: @@ -43145,7 +42767,6 @@ isset_again: goto num_index_prop; } } -str_index_prop: value = zend_hash_find_ex_ind(ht, str, IS_CONST == IS_CONST); } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { hval = Z_LVAL_P(offset); @@ -43154,28 +42775,8 @@ num_index_prop: } else if ((IS_CONST & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { offset = Z_REFVAL_P(offset); goto isset_again; - } else if (Z_TYPE_P(offset) == IS_DOUBLE) { - hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_NULL) { - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; - } else if (Z_TYPE_P(offset) == IS_FALSE) { - hval = 0; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_TRUE) { - hval = 1; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_RESOURCE) { - hval = Z_RES_HANDLE_P(offset); - goto num_index_prop; - } else if (IS_CONST == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { - GET_OP2_UNDEF_CV(offset, BP_VAR_R); - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; } else { - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - goto isset_not_found; + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); } if (opline->extended_value & ZEND_ISSET) { @@ -43186,59 +42787,17 @@ num_index_prop: result = (value == NULL || !i_zend_is_true(value)); } goto isset_dim_obj_exit; - } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { container = Z_REFVAL_P(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { goto isset_dim_obj_array; } } - if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { - offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); - } - - if ((IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - result = - ((opline->extended_value & ZEND_ISSET) == 0) ^ - Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); - } else { - zend_error(E_NOTICE, "Trying to check element of non-array"); - goto isset_not_found; - } - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ - zend_long lval; - - if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { - lval = Z_LVAL_P(offset); -isset_str_offset: - if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ - lval += (zend_long)Z_STRLEN_P(container); - } - if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { - if (opline->extended_value & ZEND_ISSET) { - result = 1; - } else { - result = (Z_STRVAL_P(container)[lval] == '0'); - } - } else { - goto isset_not_found; - } - } else { - if (IS_CONST & (IS_CV|IS_VAR)) { - ZVAL_DEREF(offset); - } - if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ - && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { - lval = zval_get_long(offset); - goto isset_str_offset; - } - goto isset_not_found; - } + if (opline->extended_value & ZEND_ISSET) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); } else { -isset_not_found: - result = ((opline->extended_value & ZEND_ISSET) == 0); + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); } isset_dim_obj_exit: @@ -46847,7 +46406,6 @@ isset_again: goto num_index_prop; } } -str_index_prop: value = zend_hash_find_ex_ind(ht, str, (IS_TMP_VAR|IS_VAR) == IS_CONST); } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { hval = Z_LVAL_P(offset); @@ -46856,28 +46414,8 @@ num_index_prop: } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { offset = Z_REFVAL_P(offset); goto isset_again; - } else if (Z_TYPE_P(offset) == IS_DOUBLE) { - hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_NULL) { - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; - } else if (Z_TYPE_P(offset) == IS_FALSE) { - hval = 0; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_TRUE) { - hval = 1; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_RESOURCE) { - hval = Z_RES_HANDLE_P(offset); - goto num_index_prop; - } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { - GET_OP2_UNDEF_CV(offset, BP_VAR_R); - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; } else { - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - goto isset_not_found; + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); } if (opline->extended_value & ZEND_ISSET) { @@ -46888,59 +46426,17 @@ num_index_prop: result = (value == NULL || !i_zend_is_true(value)); } goto isset_dim_obj_exit; - } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { container = Z_REFVAL_P(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { goto isset_dim_obj_array; } } - if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { - offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); - } - - if ((IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - result = - ((opline->extended_value & ZEND_ISSET) == 0) ^ - Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); - } else { - zend_error(E_NOTICE, "Trying to check element of non-array"); - goto isset_not_found; - } - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ - zend_long lval; - - if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { - lval = Z_LVAL_P(offset); -isset_str_offset: - if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ - lval += (zend_long)Z_STRLEN_P(container); - } - if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { - if (opline->extended_value & ZEND_ISSET) { - result = 1; - } else { - result = (Z_STRVAL_P(container)[lval] == '0'); - } - } else { - goto isset_not_found; - } - } else { - if ((IS_TMP_VAR|IS_VAR) & (IS_CV|IS_VAR)) { - ZVAL_DEREF(offset); - } - if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ - && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { - lval = zval_get_long(offset); - goto isset_str_offset; - } - goto isset_not_found; - } + if (opline->extended_value & ZEND_ISSET) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); } else { -isset_not_found: - result = ((opline->extended_value & ZEND_ISSET) == 0); + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); } isset_dim_obj_exit: @@ -52780,7 +52276,6 @@ isset_again: goto num_index_prop; } } -str_index_prop: value = zend_hash_find_ex_ind(ht, str, IS_CV == IS_CONST); } else if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { hval = Z_LVAL_P(offset); @@ -52789,28 +52284,8 @@ num_index_prop: } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(offset))) { offset = Z_REFVAL_P(offset); goto isset_again; - } else if (Z_TYPE_P(offset) == IS_DOUBLE) { - hval = zend_dval_to_lval(Z_DVAL_P(offset)); - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_NULL) { - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; - } else if (Z_TYPE_P(offset) == IS_FALSE) { - hval = 0; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_TRUE) { - hval = 1; - goto num_index_prop; - } else if (Z_TYPE_P(offset) == IS_RESOURCE) { - hval = Z_RES_HANDLE_P(offset); - goto num_index_prop; - } else if (IS_CV == IS_CV && Z_TYPE_P(offset) == IS_UNDEF) { - GET_OP2_UNDEF_CV(offset, BP_VAR_R); - str = ZSTR_EMPTY_ALLOC(); - goto str_index_prop; } else { - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - goto isset_not_found; + value = zend_find_array_dim_slow(ht, offset EXECUTE_DATA_CC); } if (opline->extended_value & ZEND_ISSET) { @@ -52821,59 +52296,17 @@ num_index_prop: result = (value == NULL || !i_zend_is_true(value)); } goto isset_dim_obj_exit; - } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + } else if ((IS_CV & (IS_VAR|IS_CV)) && EXPECTED(Z_ISREF_P(container))) { container = Z_REFVAL_P(container); if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { goto isset_dim_obj_array; } } - if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { - offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); - } - - if ((IS_CV != IS_CONST && EXPECTED(Z_TYPE_P(container) == IS_OBJECT))) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - result = - ((opline->extended_value & ZEND_ISSET) == 0) ^ - Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); - } else { - zend_error(E_NOTICE, "Trying to check element of non-array"); - goto isset_not_found; - } - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ - zend_long lval; - - if (EXPECTED(Z_TYPE_P(offset) == IS_LONG)) { - lval = Z_LVAL_P(offset); -isset_str_offset: - if (UNEXPECTED(lval < 0)) { /* Handle negative offset */ - lval += (zend_long)Z_STRLEN_P(container); - } - if (EXPECTED(lval >= 0) && (size_t)lval < Z_STRLEN_P(container)) { - if (opline->extended_value & ZEND_ISSET) { - result = 1; - } else { - result = (Z_STRVAL_P(container)[lval] == '0'); - } - } else { - goto isset_not_found; - } - } else { - if (IS_CV & (IS_CV|IS_VAR)) { - ZVAL_DEREF(offset); - } - if (Z_TYPE_P(offset) < IS_STRING /* simple scalar types */ - || (Z_TYPE_P(offset) == IS_STRING /* or numeric string */ - && IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) { - lval = zval_get_long(offset); - goto isset_str_offset; - } - goto isset_not_found; - } + if (opline->extended_value & ZEND_ISSET) { + result = zend_isset_dim_slow(container, offset EXECUTE_DATA_CC); } else { -isset_not_found: - result = ((opline->extended_value & ZEND_ISSET) == 0); + result = zend_isempty_dim_slow(container, offset EXECUTE_DATA_CC); } isset_dim_obj_exit: