From: Nikita Popov Date: Thu, 10 Oct 2019 12:44:53 +0000 (+0200) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2118f6a898297c9705ac652ad38f79590f80885b;p=php Merge branch 'PHP-7.4' --- 2118f6a898297c9705ac652ad38f79590f80885b diff --cc Zend/zend_execute.c index e6edbf6685,368d6b2dcc..d4f8ed0012 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@@ -2584,7 -2706,7 +2584,7 @@@ static zend_never_inline zend_bool zend } if (!check_type_array_assignable(prop_info->type)) { zend_throw_auto_init_in_prop_error(prop_info, "array"); -- if (result) ZVAL_ERROR(result); ++ if (result) ZVAL_UNDEF(result); return 0; } } @@@ -2600,7 -2737,7 +2600,7 @@@ if (Z_TYPE_P(ptr) == IS_UNDEF) { if (!ZEND_TYPE_ALLOW_NULL(prop_info->type)) { zend_throw_access_uninit_prop_by_ref_error(prop_info); -- if (result) ZVAL_ERROR(result); ++ if (result) ZVAL_UNDEF(result); return 0; } ZVAL_NULL(ptr); @@@ -2640,16 -2775,17 +2640,16 @@@ static zend_always_inline void zend_fet return; } - container = make_real_object(container, prop_ptr OPLINE_CC EXECUTE_DATA_CC); - if (UNEXPECTED(!container)) { - ZVAL_ERROR(result); - return; - } + zend_throw_non_object_error(container, prop_ptr OPLINE_CC EXECUTE_DATA_CC); - ZVAL_ERROR(result); ++ ZVAL_UNDEF(result); + return; } while (0); } + + zobj = Z_OBJ_P(container); if (prop_op_type == IS_CONST && - EXPECTED(Z_OBJCE_P(container) == CACHED_PTR_EX(cache_slot))) { + EXPECTED(zobj->ce == CACHED_PTR_EX(cache_slot))) { uintptr_t prop_offset = (uintptr_t)CACHED_PTR_EX(cache_slot + 1); - zend_object *zobj = Z_OBJ_P(container); if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) { ptr = OBJ_PROP(zobj, prop_offset); @@@ -2728,8 -2858,7 +2728,7 @@@ static zend_always_inline void zend_ass variable_ptr = Z_INDIRECT_P(variable_ptr); } - /* variable_ptr may be ERROR if fetching the property threw an exception. */ - if (UNEXPECTED(Z_ISERROR_P(variable_ptr))) { - if (UNEXPECTED(Z_ISERROR_P(variable_ptr) || EG(exception))) { ++ if (UNEXPECTED(EG(exception))) { variable_ptr = &EG(uninitialized_zval); } else if (UNEXPECTED(Z_TYPE(variable) != IS_INDIRECT)) { zend_throw_error(NULL, "Cannot assign by reference to overloaded object");