com php-src: zend_get_property_info takes a zend_ string* now: Zend/zend_API.c Zend/zend_object_h andlers.c Zend/zend_object_handlers.h ext/reflectio
n/php_reflection.c ext/soap/php_encoding.c
| From: | Nikita Popov | Date: | Sun, 14 Sep 2014 14:18:08 +0000 |
| Subject: | com php-src: zend_get_property_info takes a zend_ string* now: Zend/zend_API.c Zend/zend_object_h andlers.c Zend/zend_object_handlers.h ext/reflectio n/php_reflection.c ext/soap/php_encoding.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81602@lists.php.net to get a copy of this message | ||
Commit: ebc6da5628d356bafba45f4632ecd4f3db1ad128
Author: Nikita Popov <nikic@php.net> Sat, 13 Sep 2014 23:14:04 +0200
Parents: 734d0b6bfdddfcedf3958eb92912c4709c4957fd
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ebc6da5628d356bafba45f4632ecd4f3db1ad128
Log:
zend_get_property_info takes a zend_string* now
Changed paths:
M Zend/zend_API.c
M Zend/zend_object_handlers.c
M Zend/zend_object_handlers.h
M ext/reflection/php_reflection.c
M ext/soap/php_encoding.c
Diff:
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index fdbefde..9ddd3d6 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1268,13 +1268,12 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable
*properti
{
object->properties = properties;
if (object->ce->default_properties_count) {
- zval *prop, tmp;
+ zval *prop;
zend_string *key;
zend_property_info *property_info;
ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
- ZVAL_STR(&tmp, key);
- property_info = zend_get_property_info(object->ce, &tmp, 1 TSRMLS_CC);
+ property_info = zend_get_property_info(object->ce, key, 1 TSRMLS_CC);
if (property_info &&
(property_info->flags & ZEND_ACC_STATIC) == 0 &&
property_info->offset >= 0) {
@@ -1293,8 +1292,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable
*properties
zend_property_info *property_info;
ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
- ZVAL_STR(&tmp, key);
- property_info = zend_get_property_info(object->ce, &tmp, 1 TSRMLS_CC);
+ property_info = zend_get_property_info(object->ce, key, 1 TSRMLS_CC);
if (property_info &&
(property_info->flags & ZEND_ACC_STATIC) == 0 &&
property_info->offset >= 0) {
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index ea32244..956ff58 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -385,9 +385,9 @@ static zend_always_inline struct _zend_property_info *zend_get_property_info_qui
}
/* }}} */
-ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int
silent TSRMLS_DC) /* {{{ */
+ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string
*member, int silent TSRMLS_DC) /* {{{ */
{
- return zend_get_property_info_quick(ce, Z_STR_P(member), silent, NULL TSRMLS_CC);
+ return zend_get_property_info_quick(ce, member, silent, NULL TSRMLS_CC);
}
/* }}} */
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index ee6c9d9..bc8500c 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -159,7 +159,7 @@ ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce,
ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name,
zend_bool silent, void **cache_slot TSRMLS_DC);
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name,
void **cache_slot TSRMLS_DC);
ZEND_API union _zend_function *zend_std_get_constructor(zend_object *object TSRMLS_DC);
-ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int
silent TSRMLS_DC);
+ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string
*member, int silent TSRMLS_DC);
ZEND_API HashTable *zend_std_get_properties(zval *object TSRMLS_DC);
ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC);
ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC);
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 6888a6c..c52f8d1 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -3906,7 +3906,7 @@ static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args,
zend
{
zval property;
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
- zval *retval = va_arg(args, zval*), member;
+ zval *retval = va_arg(args, zval*);
/* under some circumstances, the properties hash table may contain numeric
* properties (e.g. when casting from array). This is a WONT FIX bug, at
@@ -3919,8 +3919,7 @@ static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args,
zend
return 0; /* non public cannot be dynamic */
}
- ZVAL_STR(&member, hash_key->key);
- if (zend_get_property_info(ce, &member, 1 TSRMLS_CC) == &EG(std_property_info)) {
+ if (zend_get_property_info(ce, hash_key->key, 1 TSRMLS_CC) == &EG(std_property_info)) {
EG(std_property_info).flags = ZEND_ACC_IMPLICIT_PUBLIC;
reflection_property_factory(ce, &EG(std_property_info), &property TSRMLS_CC);
add_next_index_zval(retval, &property);
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 802a077..6189f17 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1201,7 +1201,7 @@ static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC)
/* Hack for bug #32455 */
zend_property_info *property_info;
- property_info = zend_get_property_info(Z_OBJCE_P(object), &member, 1 TSRMLS_CC);
+ property_info = zend_get_property_info(Z_OBJCE_P(object), Z_STR(member), 1 TSRMLS_CC);
EG(scope) = old_scope;
if (property_info && zend_hash_exists(Z_OBJPROP_P(object), property_info->name)) {
zval_ptr_dtor(&member);