diff --git a/.gitignore b/.gitignore index f2d8d0bd293..1ee16de4c76 100644 --- a/.gitignore +++ b/.gitignore @@ -38,8 +38,6 @@ _libs acconfig.h aclocal.m4 autom4te.cache -bsd_converted -buildconf.stamp buildmk.stamp confdefs.h config.h @@ -48,11 +46,6 @@ config.h.in config.log config.nice config.status -config_vars.mk -configuration-parser.c -configuration-parser.h -configuration-parser.output -configuration-scanner.c configure conftest conftest.c @@ -172,8 +165,6 @@ ext/phar/phar.phar ext/phar/phar.1 ext/phar/phar.phar.1 ext/phar/phar.php -ext/spl/examples/.htaccess -ext/spl/examples/*.phps ext/sqlite3/tests/phpsql* # ------------------------------------------------------------------------------ Windows @@ -205,5 +196,6 @@ ext/sqlite3/tests/phpsql* # Special cases to invert previous ignore rules !ext/fileinfo/libmagic.patch +!ext/fileinfo/magicdata.patch !ext/mbstring/oniguruma.patch !ext/pcre/pcre2lib/config.h diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 455c9f8f2e7..dabb88c92de 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -7,7 +7,8 @@ PHP 7.4 INTERNALS UPGRADE NOTES d. Removed zend_check_private() e. php_win32_error_to_msg() memory management f. get_properties_for() handler / Z_OBJDEBUG_P - g. Immutable classes and op_arrays + g. Required object handlers + h. Immutable classes and op_arrays 2. Build system changes a. Abstract @@ -99,7 +100,29 @@ PHP 7.4 INTERNALS UPGRADE NOTES // ... zend_release_properties(ht); - g. Opcache may make classes and op_arrays immutable. Such classes are marked + g. The following object handlers are now required (must be non-NULL): + + * free_obj + * dtor_obj + * read_property + * write_property + * read_dimension + * write_dimension + * get_property_ptr_ptr + * has_property + * unset_property + * has_dimension + * unset_dimension + * get_properties + * get_method + * get_constructor + * get_class_name + * get_gc + + It is recommended to initialize object handler structures by copying the + std object handlers and only overwriting those you want to change. + + h. Opcache may make classes and op_arrays immutable. Such classes are marked by ZEND_ACC_IMMUTABLE flag, they are not going to be copied from opcache shard memory to process memory and must not be modified at all. Few related data structures were changed to allow addressing mutable data diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 144983ddbbf..22ce397bd34 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3116,7 +3116,7 @@ get_function_via_handler: fcc->function_handler = zend_get_call_trampoline_func(ce_org, mname, 0); call_via_handler = 1; retval = 1; - } else if (fcc->object->handlers->get_method) { + } else { fcc->function_handler = fcc->object->handlers->get_method(&fcc->object, mname, NULL); if (fcc->function_handler) { if (strict_class && @@ -3933,9 +3933,6 @@ ZEND_API void zend_update_property_ex(zend_class_entry *scope, zval *object, zen EG(fake_scope) = scope; - if (!Z_OBJ_HT_P(object)->write_property) { - zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be updated", ZSTR_VAL(name), ZSTR_VAL(Z_OBJCE_P(object)->name)); - } ZVAL_STR(&property, name); Z_OBJ_HT_P(object)->write_property(object, &property, value, NULL); @@ -3950,9 +3947,6 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const EG(fake_scope) = scope; - if (!Z_OBJ_HT_P(object)->write_property) { - zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, ZSTR_VAL(Z_OBJCE_P(object)->name)); - } ZVAL_STRINGL(&property, name, name_length); Z_OBJ_HT_P(object)->write_property(object, &property, value, NULL); zval_ptr_dtor(&property); @@ -3977,9 +3971,6 @@ ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const c EG(fake_scope) = scope; - if (!Z_OBJ_HT_P(object)->unset_property) { - zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be unset", name, ZSTR_VAL(Z_OBJCE_P(object)->name)); - } ZVAL_STRINGL(&property, name, name_length); Z_OBJ_HT_P(object)->unset_property(object, &property, 0); zval_ptr_dtor(&property); @@ -4141,10 +4132,6 @@ ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zval *object, zend EG(fake_scope) = scope; - if (!Z_OBJ_HT_P(object)->read_property) { - zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be read", ZSTR_VAL(name), ZSTR_VAL(Z_OBJCE_P(object)->name)); - } - ZVAL_STR(&property, name); value = Z_OBJ_HT_P(object)->read_property(object, &property, silent?BP_VAR_IS:BP_VAR_R, NULL, rv); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 5c79691ff2a..07a314028e4 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1338,7 +1338,7 @@ ZEND_FUNCTION(method_exists) if (zend_hash_exists(&ce->function_table, lcname)) { zend_string_release_ex(lcname, 0); RETURN_TRUE; - } else if (Z_TYPE_P(klass) == IS_OBJECT && Z_OBJ_HT_P(klass)->get_method != NULL) { + } else if (Z_TYPE_P(klass) == IS_OBJECT) { zend_object *obj = Z_OBJ_P(klass); zend_function *func = Z_OBJ_HT_P(klass)->get_method(&obj, method_name, NULL); if (func != NULL) { @@ -1401,7 +1401,6 @@ ZEND_FUNCTION(property_exists) ZVAL_STR(&property_z, property); if (Z_TYPE_P(object) == IS_OBJECT && - Z_OBJ_HANDLER_P(object, has_property) && Z_OBJ_HANDLER_P(object, has_property)(object, &property_z, 2, NULL)) { RETURN_TRUE; } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index baf54b09bfd..7ad16a9a781 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -625,17 +625,6 @@ static zend_never_inline ZEND_COLD int zend_wrong_assign_to_variable_reference(z return 1; } -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_assignment(zval *property OPLINE_DC EXECUTE_DATA_DC) -{ - zend_string *tmp_property_name; - zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name); - zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name)); - zend_tmp_string_release(tmp_property_name); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(EX_VAR(opline->result.var)); - } -} - /* this should modify object only if it's empty */ static zend_never_inline ZEND_COLD int ZEND_FASTCALL make_real_object(zval *object, zval *property OPLINE_DC EXECUTE_DATA_DC) { @@ -1112,14 +1101,6 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_illegal_offset(void) static zend_never_inline void zend_assign_to_object_dim(zval *object, zval *dim, zval *value OPLINE_DC EXECUTE_DATA_DC) { - if (UNEXPECTED(!Z_OBJ_HT_P(object)->write_dimension)) { - zend_use_object_as_array(); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_UNDEF(EX_VAR(opline->result.var)); - } - return; - } - Z_OBJ_HT_P(object)->write_dimension(object, dim, value); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { @@ -1132,8 +1113,7 @@ static zend_never_inline void zend_binary_assign_op_obj_dim(zval *object, zval * zval *z; zval rv, res; - if (Z_OBJ_HT_P(object)->read_dimension && - (z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R, &rv)) != NULL) { + if ((z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R, &rv)) != NULL) { if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { zval rv2; @@ -1335,22 +1315,6 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_read(z zend_tmp_string_release(tmp_property_name); } -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_unset(zval *property) -{ - zend_string *tmp_property_name; - zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name); - zend_error(E_NOTICE, "Trying to unset property '%s' of non-object", ZSTR_VAL(property_name)); - zend_tmp_string_release(tmp_property_name); -} - -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_check(zval *property) -{ - zend_string *tmp_property_name; - zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name); - zend_error(E_NOTICE, "Trying to check property '%s' of non-object", ZSTR_VAL(property_name)); - zend_tmp_string_release(tmp_property_name); -} - static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc) { zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated", @@ -1425,93 +1389,80 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim, static zend_never_inline void zend_post_incdec_overloaded_property(zval *object, zval *property, void **cache_slot, int inc OPLINE_DC EXECUTE_DATA_DC) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval rv, obj; - zval *z; - zval z_copy; + zval rv, obj; + zval *z; + zval z_copy; - ZVAL_OBJ(&obj, Z_OBJ_P(object)); - Z_ADDREF(obj); - z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); - if (UNEXPECTED(EG(exception))) { - OBJ_RELEASE(Z_OBJ(obj)); - ZVAL_UNDEF(EX_VAR(opline->result.var)); - return; - } - - if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) { - zval rv2; - zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); - if (z == &rv) { - zval_ptr_dtor(&rv); - } - ZVAL_COPY_VALUE(z, value); - } - - ZVAL_COPY_DEREF(&z_copy, z); - ZVAL_COPY(EX_VAR(opline->result.var), &z_copy); - if (inc) { - increment_function(&z_copy); - } else { - decrement_function(&z_copy); - } - Z_OBJ_HT(obj)->write_property(&obj, property, &z_copy, cache_slot); + ZVAL_OBJ(&obj, Z_OBJ_P(object)); + Z_ADDREF(obj); + z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); + if (UNEXPECTED(EG(exception))) { OBJ_RELEASE(Z_OBJ(obj)); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(EX_VAR(opline->result.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + return; } + + if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) { + zval rv2; + zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); + if (z == &rv) { + zval_ptr_dtor(&rv); + } + ZVAL_COPY_VALUE(z, value); + } + + ZVAL_COPY_DEREF(&z_copy, z); + ZVAL_COPY(EX_VAR(opline->result.var), &z_copy); + if (inc) { + increment_function(&z_copy); + } else { + decrement_function(&z_copy); + } + Z_OBJ_HT(obj)->write_property(&obj, property, &z_copy, cache_slot); + OBJ_RELEASE(Z_OBJ(obj)); + zval_ptr_dtor(&z_copy); + zval_ptr_dtor(z); } static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object, zval *property, void **cache_slot, int inc OPLINE_DC EXECUTE_DATA_DC) { zval rv; + zval *z, obj; + zval z_copy; - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z, obj; - zval z_copy; - - ZVAL_OBJ(&obj, Z_OBJ_P(object)); - Z_ADDREF(obj); - z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); - if (UNEXPECTED(EG(exception))) { - OBJ_RELEASE(Z_OBJ(obj)); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(EX_VAR(opline->result.var)); - } - return; - } - - if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) { - zval rv2; - zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); - - if (z == &rv) { - zval_ptr_dtor(&rv); - } - ZVAL_COPY_VALUE(z, value); - } - ZVAL_COPY_DEREF(&z_copy, z); - if (inc) { - increment_function(&z_copy); - } else { - decrement_function(&z_copy); - } - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(EX_VAR(opline->result.var), &z_copy); - } - Z_OBJ_HT(obj)->write_property(&obj, property, &z_copy, cache_slot); + ZVAL_OBJ(&obj, Z_OBJ_P(object)); + Z_ADDREF(obj); + z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); + if (UNEXPECTED(EG(exception))) { OBJ_RELEASE(Z_OBJ(obj)); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); } + return; } + + if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) { + zval rv2; + zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); + + if (z == &rv) { + zval_ptr_dtor(&rv); + } + ZVAL_COPY_VALUE(z, value); + } + ZVAL_COPY_DEREF(&z_copy, z); + if (inc) { + increment_function(&z_copy); + } else { + decrement_function(&z_copy); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), &z_copy); + } + Z_OBJ_HT(obj)->write_property(&obj, property, &z_copy, cache_slot); + OBJ_RELEASE(Z_OBJ(obj)); + zval_ptr_dtor(&z_copy); + zval_ptr_dtor(z); } static zend_never_inline void zend_assign_op_overloaded_property(zval *object, zval *property, void **cache_slot, zval *value, binary_op_type binary_op OPLINE_DC EXECUTE_DATA_DC) @@ -1521,38 +1472,31 @@ static zend_never_inline void zend_assign_op_overloaded_property(zval *object, z ZVAL_OBJ(&obj, Z_OBJ_P(object)); Z_ADDREF(obj); - if (EXPECTED(Z_OBJ_HT(obj)->read_property)) { - z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); - if (UNEXPECTED(EG(exception))) { - OBJ_RELEASE(Z_OBJ(obj)); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_UNDEF(EX_VAR(opline->result.var)); - } - return; - } - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval rv2; - zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); - - if (z == &rv) { - zval_ptr_dtor(&rv); - } - ZVAL_COPY_VALUE(z, value); - } - if (binary_op(&res, z, value) == SUCCESS) { - Z_OBJ_HT(obj)->write_property(&obj, property, &res, cache_slot); - } + z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); + if (UNEXPECTED(EG(exception))) { + OBJ_RELEASE(Z_OBJ(obj)); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(EX_VAR(opline->result.var), &res); - } - zval_ptr_dtor(z); - zval_ptr_dtor(&res); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(EX_VAR(opline->result.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); } + return; } + if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { + zval rv2; + zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); + + if (z == &rv) { + zval_ptr_dtor(&rv); + } + ZVAL_COPY_VALUE(z, value); + } + if (binary_op(&res, z, value) == SUCCESS) { + Z_OBJ_HT(obj)->write_property(&obj, property, &res, cache_slot); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), &res); + } + zval_ptr_dtor(z); + zval_ptr_dtor(&res); OBJ_RELEASE(Z_OBJ(obj)); } @@ -1660,16 +1604,6 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_new_element_for_s zend_throw_error(NULL, "[] operator not supported for strings"); } -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_access_undefined_propery_in_overloaded_object(void) -{ - zend_throw_error(NULL, "Cannot access undefined property for object with overloaded property access"); -} - -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_unsupported_property_reference(void) -{ - zend_error(E_WARNING, "This object doesn't support property references"); -} - static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht, const zval *dim, int dim_type, int type EXECUTE_DATA_DC) { zval *retval = NULL; @@ -1844,39 +1778,34 @@ fetch_from_array: zval_undefined_cv(EX(opline)->op2.var EXECUTE_DATA_CC); dim = &EG(uninitialized_zval); } - if (!Z_OBJ_HT_P(container)->read_dimension) { - zend_use_object_as_array(); - ZVAL_ERROR(result); - } else { - if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { - dim++; - } - retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result); + if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result); - if (UNEXPECTED(retval == &EG(uninitialized_zval))) { - zend_class_entry *ce = Z_OBJCE_P(container); + if (UNEXPECTED(retval == &EG(uninitialized_zval))) { + zend_class_entry *ce = Z_OBJCE_P(container); - ZVAL_NULL(result); - zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name)); - } else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) { - if (!Z_ISREF_P(retval)) { - if (result != retval) { - ZVAL_COPY(result, retval); - retval = result; - } - if (Z_TYPE_P(retval) != IS_OBJECT) { - zend_class_entry *ce = Z_OBJCE_P(container); - zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name)); - } - } else if (UNEXPECTED(Z_REFCOUNT_P(retval) == 1)) { - ZVAL_UNREF(retval); - } + ZVAL_NULL(result); + zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name)); + } else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) { + if (!Z_ISREF_P(retval)) { if (result != retval) { - ZVAL_INDIRECT(result, retval); + ZVAL_COPY(result, retval); + retval = result; } - } else { - ZVAL_ERROR(result); + if (Z_TYPE_P(retval) != IS_OBJECT) { + zend_class_entry *ce = Z_OBJCE_P(container); + zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name)); + } + } else if (UNEXPECTED(Z_REFCOUNT_P(retval) == 1)) { + ZVAL_UNREF(retval); } + if (result != retval) { + ZVAL_INDIRECT(result, retval); + } + } else { + ZVAL_ERROR(result); } } else { if (type != BP_VAR_W && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { @@ -2004,25 +1933,20 @@ try_string_offset: zval_undefined_cv(EX(opline)->op2.var EXECUTE_DATA_CC); dim = &EG(uninitialized_zval); } - if (!Z_OBJ_HT_P(container)->read_dimension) { - zend_use_object_as_array(); - ZVAL_NULL(result); - } else { - if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { - dim++; - } - retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result); + if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result); - ZEND_ASSERT(result != NULL); - if (retval) { - if (result != retval) { - ZVAL_COPY_DEREF(result, retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(result); - } - } else { - ZVAL_NULL(result); + ZEND_ASSERT(result != NULL); + if (retval) { + if (result != retval) { + ZVAL_COPY_DEREF(result, retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(result); } + } else { + ZVAL_NULL(result); } } else { if (type != BP_VAR_IS && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { @@ -2101,12 +2025,7 @@ static zend_never_inline int ZEND_FASTCALL zend_isset_dim_slow(zval *container, } 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_use_object_as_array(); - return 0; - } + return Z_OBJ_HT_P(container)->has_dimension(container, offset, 0); } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ zend_long lval; @@ -2146,12 +2065,7 @@ static zend_never_inline int ZEND_FASTCALL zend_isempty_dim_slow(zval *container } 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_use_object_as_array(); - return 1; - } + return !Z_OBJ_HT_P(container)->has_dimension(container, offset, 1); } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ zend_long lval; @@ -2185,6 +2099,7 @@ str_offset: 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 OPLINE_DC) { + zval *ptr; if (container_op_type != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { do { if (Z_ISREF_P(container)) { @@ -2228,29 +2143,17 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c } } } - if (EXPECTED(Z_OBJ_HT_P(container)->get_property_ptr_ptr)) { - zval *ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, cache_slot); - if (NULL == ptr) { - if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) { -use_read_property: - ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result); - if (ptr != result) { - ZVAL_INDIRECT(result, ptr); - } else if (UNEXPECTED(Z_ISREF_P(ptr) && Z_REFCOUNT_P(ptr) == 1)) { - ZVAL_UNREF(ptr); - } - } else { - zend_access_undefined_propery_in_overloaded_object(); - ZVAL_ERROR(result); - } - } else { + + ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, cache_slot); + if (NULL == ptr) { + ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result); + if (ptr != result) { ZVAL_INDIRECT(result, ptr); + } else if (UNEXPECTED(Z_ISREF_P(ptr) && Z_REFCOUNT_P(ptr) == 1)) { + ZVAL_UNREF(ptr); } - } else if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) { - goto use_read_property; } else { - zend_unsupported_property_reference(); - ZVAL_ERROR(result); + ZVAL_INDIRECT(result, ptr); } } diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index 1732fdefc40..15a594da606 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -617,17 +617,15 @@ tail_call: GC_REF_SET_BLACK(ref); if (GC_TYPE(ref) == IS_OBJECT) { - zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - (get_gc = obj->handlers->get_gc) != NULL)) { + if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) { int n; zval *zv, *end; zval tmp; ZVAL_OBJ(&tmp, obj); - ht = get_gc(&tmp, &zv, &n); + ht = obj->handlers->get_gc(&tmp, &zv, &n); end = zv + n; if (EXPECTED(!ht)) { if (!n) return; @@ -727,17 +725,15 @@ tail_call: GC_REF_SET_COLOR(ref, GC_GREY); if (GC_TYPE(ref) == IS_OBJECT) { - zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - (get_gc = obj->handlers->get_gc) != NULL)) { + if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) { int n; zval *zv, *end; zval tmp; ZVAL_OBJ(&tmp, obj); - ht = get_gc(&tmp, &zv, &n); + ht = obj->handlers->get_gc(&tmp, &zv, &n); end = zv + n; if (EXPECTED(!ht)) { if (!n) return; @@ -883,17 +879,15 @@ tail_call: } else { GC_REF_SET_COLOR(ref, GC_WHITE); if (GC_TYPE(ref) == IS_OBJECT) { - zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - (get_gc = obj->handlers->get_gc) != NULL)) { + if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) { int n; zval *zv, *end; zval tmp; ZVAL_OBJ(&tmp, obj); - ht = get_gc(&tmp, &zv, &n); + ht = obj->handlers->get_gc(&tmp, &zv, &n); end = zv + n; if (EXPECTED(!ht)) { if (!n) return; @@ -1023,11 +1017,9 @@ tail_call: } if (GC_TYPE(ref) == IS_OBJECT) { - zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - (get_gc = obj->handlers->get_gc) != NULL)) { + if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) { int n; zval *zv, *end; zval tmp; @@ -1036,13 +1028,12 @@ tail_call: if (!GC_INFO(ref)) { gc_add_garbage(ref); } - if (obj->handlers->dtor_obj && - ((obj->handlers->dtor_obj != zend_objects_destroy_object) || - (obj->ce->destructor != NULL))) { + if (obj->handlers->dtor_obj != zend_objects_destroy_object || + obj->ce->destructor != NULL) { *flags |= GC_HAS_DESTRUCTORS; } ZVAL_OBJ(&tmp, obj); - ht = get_gc(&tmp, &zv, &n); + ht = obj->handlers->get_gc(&tmp, &zv, &n); end = zv + n; if (EXPECTED(!ht)) { if (!n) return count; @@ -1193,17 +1184,15 @@ tail_call: } if (GC_TYPE(ref) == IS_OBJECT) { - zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - (get_gc = obj->handlers->get_gc) != NULL)) { + if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) { int n; zval *zv, *end; zval tmp; ZVAL_OBJ(&tmp, obj); - ht = get_gc(&tmp, &zv, &n); + ht = obj->handlers->get_gc(&tmp, &zv, &n); end = zv + n; if (EXPECTED(!ht)) { if (!n) return; @@ -1341,9 +1330,8 @@ ZEND_API int zend_gc_collect_cycles(void) GC_TRACE_REF(obj, "calling destructor"); GC_ADD_FLAGS(obj, IS_OBJ_DESTRUCTOR_CALLED); - if (obj->handlers->dtor_obj - && (obj->handlers->dtor_obj != zend_objects_destroy_object - || obj->ce->destructor)) { + if (obj->handlers->dtor_obj != zend_objects_destroy_object + || obj->ce->destructor) { GC_ADDREF(obj); obj->handlers->dtor_obj(obj); GC_DELREF(obj); @@ -1392,11 +1380,9 @@ ZEND_API int zend_gc_collect_cycles(void) (GC_TYPE_INFO(obj) & ~GC_TYPE_MASK); if (!(OBJ_FLAGS(obj) & IS_OBJ_FREE_CALLED)) { GC_ADD_FLAGS(obj, IS_OBJ_FREE_CALLED); - if (obj->handlers->free_obj) { - GC_ADDREF(obj); - obj->handlers->free_obj(obj); - GC_DELREF(obj); - } + GC_ADDREF(obj); + obj->handlers->free_obj(obj); + GC_DELREF(obj); } ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST(obj->handle); diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 753e8460e42..6d347f4d5f9 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -153,36 +153,35 @@ typedef int (*zend_object_do_operation_t)(zend_uchar opcode, zval *result, zval struct _zend_object_handlers { /* offset of real object header (usually zero) */ int offset; - /* general object functions */ - zend_object_free_obj_t free_obj; - zend_object_dtor_obj_t dtor_obj; - zend_object_clone_obj_t clone_obj; - /* individual object functions */ - zend_object_read_property_t read_property; - zend_object_write_property_t write_property; - zend_object_read_dimension_t read_dimension; - zend_object_write_dimension_t write_dimension; - zend_object_get_property_ptr_ptr_t get_property_ptr_ptr; - zend_object_get_t get; - zend_object_set_t set; - zend_object_has_property_t has_property; - zend_object_unset_property_t unset_property; - zend_object_has_dimension_t has_dimension; - zend_object_unset_dimension_t unset_dimension; - zend_object_get_properties_t get_properties; /* required */ - zend_object_get_method_t get_method; - zend_object_call_method_t call_method; - zend_object_get_constructor_t get_constructor; - zend_object_get_class_name_t get_class_name; - zend_object_compare_t compare_objects; - zend_object_cast_t cast_object; - zend_object_count_elements_t count_elements; - zend_object_get_debug_info_t get_debug_info; - zend_object_get_closure_t get_closure; - zend_object_get_gc_t get_gc; - zend_object_do_operation_t do_operation; - zend_object_compare_zvals_t compare; - zend_object_get_properties_for_t get_properties_for; /* optional */ + /* object handlers */ + zend_object_free_obj_t free_obj; /* required */ + zend_object_dtor_obj_t dtor_obj; /* required */ + zend_object_clone_obj_t clone_obj; /* optional */ + zend_object_read_property_t read_property; /* required */ + zend_object_write_property_t write_property; /* required */ + zend_object_read_dimension_t read_dimension; /* required */ + zend_object_write_dimension_t write_dimension; /* required */ + zend_object_get_property_ptr_ptr_t get_property_ptr_ptr; /* required */ + zend_object_get_t get; /* optional */ + zend_object_set_t set; /* optional */ + zend_object_has_property_t has_property; /* required */ + zend_object_unset_property_t unset_property; /* required */ + zend_object_has_dimension_t has_dimension; /* required */ + zend_object_unset_dimension_t unset_dimension; /* required */ + zend_object_get_properties_t get_properties; /* required */ + zend_object_get_method_t get_method; /* required */ + zend_object_call_method_t call_method; /* optional */ + zend_object_get_constructor_t get_constructor; /* required */ + zend_object_get_class_name_t get_class_name; /* required */ + zend_object_compare_t compare_objects; /* optional */ + zend_object_cast_t cast_object; /* optional */ + zend_object_count_elements_t count_elements; /* optional */ + zend_object_get_debug_info_t get_debug_info; /* optional */ + zend_object_get_closure_t get_closure; /* optional */ + zend_object_get_gc_t get_gc; /* required */ + zend_object_do_operation_t do_operation; /* optional */ + zend_object_compare_zvals_t compare; /* optional */ + zend_object_get_properties_for_t get_properties_for; /* optional */ }; BEGIN_EXTERN_C() diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index 672a580caa6..23c88424118 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -49,9 +49,8 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_call_destructors(zend_objects_sto if (!(OBJ_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) { GC_ADD_FLAGS(obj, IS_OBJ_DESTRUCTOR_CALLED); - if (obj->handlers->dtor_obj - && (obj->handlers->dtor_obj != zend_objects_destroy_object - || obj->ce->destructor)) { + if (obj->handlers->dtor_obj != zend_objects_destroy_object + || obj->ce->destructor) { GC_ADDREF(obj); obj->handlers->dtor_obj(obj); GC_DELREF(obj); @@ -98,7 +97,7 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_ if (IS_OBJ_VALID(obj)) { if (!(OBJ_FLAGS(obj) & IS_OBJ_FREE_CALLED)) { GC_ADD_FLAGS(obj, IS_OBJ_FREE_CALLED); - if (obj->handlers->free_obj && obj->handlers->free_obj != zend_object_std_dtor) { + if (obj->handlers->free_obj != zend_object_std_dtor) { GC_ADDREF(obj); obj->handlers->free_obj(obj); GC_DELREF(obj); @@ -113,11 +112,9 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_ if (IS_OBJ_VALID(obj)) { if (!(OBJ_FLAGS(obj) & IS_OBJ_FREE_CALLED)) { GC_ADD_FLAGS(obj, IS_OBJ_FREE_CALLED); - if (obj->handlers->free_obj) { - GC_ADDREF(obj); - obj->handlers->free_obj(obj); - GC_DELREF(obj); - } + GC_ADDREF(obj); + obj->handlers->free_obj(obj); + GC_DELREF(obj); } } } while (obj_ptr != end); @@ -163,9 +160,8 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ * if (!(OBJ_FLAGS(object) & IS_OBJ_DESTRUCTOR_CALLED)) { GC_ADD_FLAGS(object, IS_OBJ_DESTRUCTOR_CALLED); - if (object->handlers->dtor_obj - && (object->handlers->dtor_obj != zend_objects_destroy_object - || object->ce->destructor)) { + if (object->handlers->dtor_obj != zend_objects_destroy_object + || object->ce->destructor) { GC_ADDREF(object); object->handlers->dtor_obj(object); GC_DELREF(object); @@ -179,11 +175,9 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ * EG(objects_store).object_buckets[handle] = SET_OBJ_INVALID(object); if (!(OBJ_FLAGS(object) & IS_OBJ_FREE_CALLED)) { GC_ADD_FLAGS(object, IS_OBJ_FREE_CALLED); - if (object->handlers->free_obj) { - GC_ADDREF(object); - object->handlers->free_obj(object); - GC_DELREF(object); - } + GC_ADDREF(object); + object->handlers->free_obj(object); + GC_DELREF(object); } ptr = ((char*)object) - object->handlers->offset; GC_REMOVE_FROM_BUFFER(object); diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 854134f520c..8c43cbaa101 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -822,8 +822,7 @@ ZEND_VM_HELPER(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV, /* here we are sure we are dealing with an object */ ZEND_VM_C_LABEL(assign_op_object): - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -1084,8 +1083,7 @@ ZEND_VM_HELPER(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV, /* here we are sure we are dealing with an object */ ZEND_VM_C_LABEL(pre_incdec_object): - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -1162,8 +1160,7 @@ ZEND_VM_HELPER(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV, /* here we are sure we are dealing with an object */ ZEND_VM_C_LABEL(post_incdec_object): - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -1795,7 +1792,9 @@ ZEND_VM_HOT_OBJ_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMPVAR|UNUSED|THIS|CV, CONST if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - ZEND_VM_C_GOTO(fetch_obj_r_no_object); + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + ZEND_VM_C_GOTO(fetch_obj_r_finish); } while (0); } @@ -1847,21 +1846,16 @@ ZEND_VM_HOT_OBJ_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMPVAR|UNUSED|THIS|CV, CONST GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -ZEND_VM_C_LABEL(fetch_obj_r_no_object): - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +ZEND_VM_C_LABEL(fetch_obj_r_finish): FREE_OP2(); FREE_OP1(); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -1939,7 +1933,8 @@ ZEND_VM_COLD_CONST_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMPVAR|UNUSED|THIS|CV, C break; } } - ZEND_VM_C_GOTO(fetch_obj_is_no_object); + ZVAL_NULL(EX_VAR(opline->result.var)); + ZEND_VM_C_GOTO(fetch_obj_is_finish); } while (0); } @@ -1989,19 +1984,14 @@ ZEND_VM_COLD_CONST_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMPVAR|UNUSED|THIS|CV, C } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -ZEND_VM_C_LABEL(fetch_obj_is_no_object): - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +ZEND_VM_C_LABEL(fetch_obj_is_finish): FREE_OP2(); FREE_OP1(); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -2179,12 +2169,6 @@ ZEND_VM_C_LABEL(fast_assign_obj): } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - FREE_OP_DATA(); - ZEND_VM_C_GOTO(exit_assign_obj); - } - if (OP_DATA_TYPE == IS_CV || OP_DATA_TYPE == IS_VAR) { ZVAL_DEREF(value); } @@ -3072,13 +3056,6 @@ ZEND_VM_HOT_OBJ_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|THIS|CV, } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - FREE_OP2(); - FREE_OP1(); - HANDLE_EXCEPTION(); - } - if (OP2_TYPE == IS_CONST) { function_name = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); } @@ -5599,14 +5576,10 @@ ZEND_VM_C_LABEL(num_index_dim): offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if (OP2_TYPE == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if (OP2_TYPE == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -5642,11 +5615,7 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_S break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); FREE_OP2(); @@ -6367,22 +6336,20 @@ ZEND_VM_COLD_CONST_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, CONST|TMPVAR|UNUSED if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - ZEND_VM_C_GOTO(isset_no_object); + result = (opline->extended_value & ZEND_ISEMPTY); + ZEND_VM_C_GOTO(isset_object_finish); } } else { - ZEND_VM_C_GOTO(isset_no_object); + result = (opline->extended_value & ZEND_ISEMPTY); + ZEND_VM_C_GOTO(isset_object_finish); } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -ZEND_VM_C_LABEL(isset_no_object): - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +ZEND_VM_C_LABEL(isset_object_finish): FREE_OP2(); FREE_OP1(); ZEND_VM_SMART_BRANCH(result, 1); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index ea3b58537dc..20d55eb1ba2 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4652,7 +4652,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -4704,21 +4706,17 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -4750,7 +4748,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -4800,19 +4799,15 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -5039,13 +5034,6 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_ } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CONST == IS_CONST) { function_name = RT_CONSTANT(opline, opline->op2); } @@ -5723,21 +5711,20 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PRO if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); @@ -6826,7 +6813,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -6878,21 +6867,16 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -6925,7 +6909,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -6975,19 +6960,14 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -7215,13 +7195,6 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_ } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - zval_ptr_dtor_nogc(free_op2); - - HANDLE_EXCEPTION(); - } - if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { function_name = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC); } @@ -7699,22 +7672,20 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PRO if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_SMART_BRANCH(result, 1); @@ -9914,7 +9885,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -9966,21 +9939,17 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -10012,7 +9981,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -10062,19 +10032,15 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -10301,13 +10267,6 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_ } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CV == IS_CONST) { function_name = EX_VAR(opline->op2.var); } @@ -10784,21 +10743,20 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PRO if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); @@ -13659,7 +13617,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_ if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -13711,21 +13671,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_ GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -13757,7 +13713,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -13807,19 +13764,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -14019,13 +13972,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - zval_ptr_dtor_nogc(free_op1); - HANDLE_EXCEPTION(); - } - if (IS_CONST == IS_CONST) { function_name = RT_CONSTANT(opline, opline->op2); } @@ -14363,21 +14309,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op1); ZEND_VM_SMART_BRANCH(result, 1); @@ -15267,7 +15212,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -15319,21 +15266,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -15366,7 +15308,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVA break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -15416,19 +15359,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVA } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -15629,13 +15567,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - zval_ptr_dtor_nogc(free_op2); - zval_ptr_dtor_nogc(free_op1); - HANDLE_EXCEPTION(); - } - if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { function_name = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC); } @@ -15842,22 +15773,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); ZEND_VM_SMART_BRANCH(result, 1); @@ -17146,7 +17075,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HAN if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -17198,21 +17129,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HAN GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -17244,7 +17171,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HA break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -17294,19 +17222,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HA } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -17506,13 +17430,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - zval_ptr_dtor_nogc(free_op1); - HANDLE_EXCEPTION(); - } - if (IS_CV == IS_CONST) { function_name = EX_VAR(opline->op2.var); } @@ -17719,21 +17636,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op1); ZEND_VM_SMART_BRANCH(result, 1); @@ -21899,8 +21815,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -22325,8 +22240,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -22402,8 +22316,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -22712,12 +22625,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -22833,12 +22740,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -22954,12 +22855,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -23075,12 +22970,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -23998,14 +23887,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -24040,11 +23925,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDL break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; @@ -24264,8 +24145,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -24692,8 +24572,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -24770,8 +24649,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -25082,12 +24960,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -25203,12 +25075,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -25324,12 +25190,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -25445,12 +25305,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -26241,14 +26095,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -26284,11 +26134,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HAND break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); zval_ptr_dtor_nogc(free_op2); @@ -28162,8 +28008,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -28588,8 +28433,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -28665,8 +28509,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -28975,12 +28818,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -29096,12 +28933,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -29217,12 +29048,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -29338,12 +29163,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -30238,14 +30057,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -30280,11 +30095,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER( break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; @@ -30746,8 +30557,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -30887,8 +30697,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -30964,8 +30773,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -31038,7 +30846,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_U if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -31090,21 +30900,17 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_U GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -31181,7 +30987,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -31231,19 +31038,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -31383,12 +31186,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -31504,12 +31301,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -31625,12 +31416,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -31746,12 +31531,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -31932,13 +31711,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_S } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CONST == IS_CONST) { function_name = RT_CONSTANT(opline, opline->op2); } @@ -32245,11 +32017,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HA break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); @@ -32278,21 +32046,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); @@ -32472,8 +32239,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -32613,8 +32379,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -32691,8 +32456,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -32766,7 +32530,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -32818,21 +32584,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -32910,7 +32671,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVA break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -32960,19 +32722,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVA } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -33113,12 +32870,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -33234,12 +32985,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -33355,12 +33100,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -33476,12 +33215,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -33663,13 +33396,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - zval_ptr_dtor_nogc(free_op2); - - HANDLE_EXCEPTION(); - } - if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { function_name = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC); } @@ -33889,11 +33615,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_H break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); zval_ptr_dtor_nogc(free_op2); @@ -33923,22 +33645,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_SMART_BRANCH(result, 1); @@ -34852,8 +34572,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -34993,8 +34712,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -35070,8 +34788,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -35144,7 +34861,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HAN if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -35196,21 +34915,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HAN GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -35287,7 +35002,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HA break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -35337,19 +35053,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HA } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -35489,12 +35201,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -35610,12 +35316,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -35731,12 +35431,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -35852,12 +35546,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -36038,13 +35726,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CV == IS_CONST) { function_name = EX_VAR(opline->op2.var); } @@ -36264,11 +35945,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDL break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); @@ -36297,21 +35974,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); @@ -38802,8 +38478,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -39228,8 +38903,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -39305,8 +38979,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -39621,7 +39294,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_C if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -39673,21 +39348,17 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_C GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -39764,7 +39435,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HAN break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -39814,19 +39486,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HAN } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -39966,12 +39634,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -40087,12 +39749,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -40208,12 +39864,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -40329,12 +39979,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -41045,13 +40689,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_S } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CONST == IS_CONST) { function_name = RT_CONSTANT(opline, opline->op2); } @@ -41353,14 +40990,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -41395,11 +41028,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLE break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); @@ -41576,21 +41205,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); @@ -42691,8 +42319,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -43119,8 +42746,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -43197,8 +42823,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -43389,7 +43014,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -43441,21 +43068,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -43533,7 +43155,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HA break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -43583,19 +43206,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HA } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -43736,12 +43354,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -43857,12 +43469,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -43978,12 +43584,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -44099,12 +43699,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -44759,13 +44353,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - zval_ptr_dtor_nogc(free_op2); - - HANDLE_EXCEPTION(); - } - if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { function_name = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC); } @@ -45013,14 +44600,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -45056,11 +44639,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDL break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); zval_ptr_dtor_nogc(free_op2); @@ -45162,22 +44741,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_SMART_BRANCH(result, 1); @@ -48444,8 +48021,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -48870,8 +48446,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -48947,8 +48522,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -49138,7 +48712,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -49190,21 +48766,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -49281,7 +48853,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLE break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -49331,19 +48904,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLE } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -49483,12 +49052,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -49604,12 +49167,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -49725,12 +49282,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -49846,12 +49397,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -50610,13 +50155,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CV == IS_CONST) { function_name = EX_VAR(opline->op2.var); } @@ -50864,14 +50402,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -50906,11 +50440,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(Z break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); @@ -51011,21 +50541,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); diff --git a/build/build.mk b/build/build.mk index 1ce958fa557..4fb49cd9ac6 100644 --- a/build/build.mk +++ b/build/build.mk @@ -29,7 +29,6 @@ all: $(STAMP) $(ALWAYS) @$(MAKE) -s -f build/build2.mk generated_lists: - @echo makefile_am_files = Zend/Makefile.am TSRM/Makefile.am > $@ @echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \ Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@ diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 8424c3acfc0..13e31f945ab 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -562,7 +562,7 @@ zend_object_handlers php_com_object_handlers = { com_object_count, NULL, /* get_debug_info */ NULL, /* get_closure */ - NULL, /* get_gc */ + zend_std_get_gc, /* get_gc */ }; void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable) diff --git a/ext/iconv/tests/eucjp2iso2022jp.phpt b/ext/iconv/tests/eucjp2iso2022jp.phpt index 19cb0f736a1..6700ac91979 100644 --- a/ext/iconv/tests/eucjp2iso2022jp.phpt +++ b/ext/iconv/tests/eucjp2iso2022jp.phpt @@ -6,7 +6,6 @@ EUC-JP to ISO-2022-JP error_reporting=2039 --FILE-- diff --git a/ext/iconv/tests/translit-failure.phpt b/ext/iconv/tests/translit-failure.phpt index 2132e7e130f..1571a316c1a 100644 --- a/ext/iconv/tests/translit-failure.phpt +++ b/ext/iconv/tests/translit-failure.phpt @@ -9,7 +9,6 @@ include('skipif.inc'); error_reporting=2039 --FILE-- obj) != IS_UNDEF && Z_OBJ_HANDLER(intern->obj, has_property)) { + if (Z_TYPE(intern->obj) != IS_UNDEF) { ZVAL_STR_COPY(&property, name); if (Z_OBJ_HANDLER(intern->obj, has_property)(&intern->obj, &property, 2, NULL)) { zval_ptr_dtor(&property); diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index debdbd8a3c5..6cc0bc1d979 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -899,10 +899,8 @@ static zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_st function_handler = zend_std_get_method(zobject, method, key); if (!function_handler) { if ((function_handler = zend_hash_find_ptr(&Z_OBJCE_P(zobj)->function_table, method)) == NULL) { - if (Z_OBJ_HT_P(zobj)->get_method) { - *zobject = Z_OBJ_P(zobj); - function_handler = (*zobject)->handlers->get_method(zobject, method, key); - } + *zobject = Z_OBJ_P(zobj); + function_handler = (*zobject)->handlers->get_method(zobject, method, key); } else { *zobject = Z_OBJ_P(zobj); } diff --git a/ext/standard/array.c b/ext/standard/array.c index 4d94c54ff13..4e2916a7eb3 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4097,10 +4097,6 @@ static inline zval *array_column_fetch_prop(zval *data, zval *name, zval *rv) /* zval *prop = NULL; if (Z_TYPE_P(data) == IS_OBJECT) { - if (!Z_OBJ_HANDLER_P(data, has_property) || !Z_OBJ_HANDLER_P(data, read_property)) { - return NULL; - } - /* The has_property check is first performed in "exists" mode (which returns true for * properties that are null but exist) and then in "has" mode to handle objects that * implement __isset (which is not called in "exists" mode). */ diff --git a/ext/xml/tests/xml_parser_get_option_variation3.phpt b/ext/xml/tests/xml_parser_get_option_variation3.phpt new file mode 100644 index 00000000000..839daa96dd0 --- /dev/null +++ b/ext/xml/tests/xml_parser_get_option_variation3.phpt @@ -0,0 +1,29 @@ +--TEST-- +xml_parser_get_option() with XML_OPTION_SKIP_TAGSTART and XML_OPTION_SKIP_WHITE +--SKIPIF-- + +--FILE-- + +--EXPECT-- +defaults: +int(0) +int(0) +setting: +bool(true) +bool(true) +getting: +int(7) +int(1) diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 9b3baf6b9aa..9868c5e3c4c 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -1662,6 +1662,12 @@ PHP_FUNCTION(xml_parser_get_option) case PHP_XML_OPTION_CASE_FOLDING: RETURN_LONG(parser->case_folding); break; + case PHP_XML_OPTION_SKIP_TAGSTART: + RETURN_LONG(parser->toffset); + break; + case PHP_XML_OPTION_SKIP_WHITE: + RETURN_LONG(parser->skipwhite); + break; case PHP_XML_OPTION_TARGET_ENCODING: RETURN_STRING((char *)parser->target_encoding); break; diff --git a/scripts/dev/phpextdist b/scripts/dev/phpextdist index 97df70020df..316a8bd5d6b 100755 --- a/scripts/dev/phpextdist +++ b/scripts/dev/phpextdist @@ -13,7 +13,7 @@ if test ! -f Makefile.in || test ! -f config.m4; then fi rm -rf modules *.lo *.o *.la config.status config.cache \ -config.log libtool php_config.h config_vars.mk Makefile +config.log libtool php_config.h Makefile myname=`basename \`pwd\`` cd ..