com php-src: Fixed incorrect argument types: Zend/zend_execut e.h Zend/zend_object_handlers.c ext/standard/var. c
| From: | Bob Weinand | Date: | Fri, 27 May 2016 10:24:52 +0000 |
| Subject: | com php-src: Fixed incorrect argument types: Zend/zend_execut e.h Zend/zend_object_handlers.c ext/standard/var. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95500@lists.php.net to get a copy of this message | ||
Commit: 03e7112bf477ae2a439ef02aa2120eba80500a9c
Author: Dmitry Stogov <dmitry@zend.com> Fri, 27 May 2016 13:24:52 +0300
Parents: 037da58946e8ea19a95c711f33fa9d7d4e79c75a
Branches: typed_ref_properties
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=03e7112bf477ae2a439ef02aa2120eba80500a9c
Log:
Fixed incorrect argument types
Changed paths:
M Zend/zend_execute.h
M Zend/zend_object_handlers.c
M ext/standard/var.c
Diff:
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index c8a14ac..9aea0bd 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -366,7 +366,7 @@ void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t
#define ZEND_CLASS_HAS_TYPE_HINTS(ce) ((ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) ==
ZEND_ACC_HAS_TYPE_HINTS)
-static zend_always_inline zend_property_info* zend_object_fetch_property_type_info(zval *object,
zend_string *property, void **cache_slot)
+static zend_always_inline zend_property_info* zend_object_fetch_property_type_info(zend_class_entry
*ce, zend_string *property, void **cache_slot)
{
zend_property_info *info;
@@ -375,11 +375,11 @@ static zend_always_inline zend_property_info*
zend_object_fetch_property_type_in
return (zend_property_info*) CACHED_PTR_EX(cache_slot + 2);
}
- if (EXPECTED(!ZEND_CLASS_HAS_TYPE_HINTS(Z_OBJCE_P(object)))) {
+ if (EXPECTED(!ZEND_CLASS_HAS_TYPE_HINTS(ce))) {
return NULL;
}
- info = zend_get_property_info(Z_OBJCE_P(object), property, 1);
+ info = zend_get_property_info(ce, property, 1);
if (EXPECTED(info)
&& UNEXPECTED(info != ZEND_WRONG_PROPERTY_INFO)
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 898b4ec..3639a9d 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -676,7 +676,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
zval_ptr_dtor(&tmp_object);
if (UNEXPECTED(ZEND_CLASS_HAS_TYPE_HINTS(zobj->ce) &&
- (prop_info = zend_object_fetch_property_type_info(object, Z_STR_P(member), cache_slot)))) {
+ (prop_info = zend_object_fetch_property_type_info(Z_OBJCE_P(object), Z_STR_P(member),
cache_slot)))) {
zval tmp, *val;
val = zend_verify_property_type(prop_info, retval, &tmp,
(zobj->ce->__get->common.fn_flags & ZEND_ACC_STRICT_TYPES) != 0);
@@ -694,7 +694,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
}
}
if ((type != BP_VAR_IS)) {
- if (UNEXPECTED(prop_info = zend_object_fetch_property_type_info(object, Z_STR_P(member),
cache_slot))
+ if (UNEXPECTED(prop_info = zend_object_fetch_property_type_info(Z_OBJCE_P(object),
Z_STR_P(member), cache_slot))
&& UNEXPECTED(!prop_info->allow_null)) {
zend_throw_exception_ex(zend_ce_type_error, prop_info->type,
"Typed property %s::$%s must not be accessed before initialization",
@@ -737,7 +737,7 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, v
if (EXPECTED(property_offset != ZEND_DYNAMIC_PROPERTY_OFFSET)) {
variable_ptr = OBJ_PROP(zobj, property_offset);
if (Z_TYPE_P(variable_ptr) != IS_UNDEF) {
- zend_property_info *prop_info = zend_object_fetch_property_type_info(object, Z_STR_P(member),
cache_slot);
+ zend_property_info *prop_info = zend_object_fetch_property_type_info(Z_OBJCE_P(object),
Z_STR_P(member), cache_slot);
zval tmp, *val;
if (UNEXPECTED(prop_info)) {
@@ -806,7 +806,7 @@ write_std_property:
zend_property_info *prop_info;
zval tmp, *val;
- if (UNEXPECTED(prop_info = zend_object_fetch_property_type_info(object, Z_STR_P(member),
cache_slot))) {
+ if (UNEXPECTED(prop_info = zend_object_fetch_property_type_info(Z_OBJCE_P(object),
Z_STR_P(member), cache_slot))) {
val = zend_verify_property_type(prop_info, value, &tmp,
ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data)));
if (UNEXPECTED(!val)) {
zend_verify_property_type_error(prop_info, Z_STR_P(member), value);
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 4733916..e46c7db 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -178,7 +178,7 @@ again:
}
if (key) {
- prop_info = zend_object_fetch_property_type_info(struc, key, NULL);
+ prop_info = zend_object_fetch_property_type_info(Z_OBJCE_P(struc), key, NULL);
}
if (!Z_ISUNDEF_P(val) || prop_info) {
@@ -369,7 +369,7 @@ again:
}
if (key) {
- prop_info = zend_object_fetch_property_type_info(struc, key, NULL);
+ prop_info = zend_object_fetch_property_type_info(Z_OBJCE_P(struc), key, NULL);
}
if (!Z_ISUNDEF_P(val) || prop_info) {