diff options
author | Antony Dovgal <tony2001@php.net> | 2005-11-23 18:51:44 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2005-11-23 18:51:44 +0000 |
commit | 794c2e8e5d8d0fdf9568f9263aaf30c16df4e0cb (patch) | |
tree | 618d37234788db9d7486da56465a1ad188266ea7 /Zend | |
parent | b9f0ff7aabb78bfe2d947bd415cc3c03328eb11c (diff) | |
download | php-git-794c2e8e5d8d0fdf9568f9263aaf30c16df4e0cb.tar.gz |
change zend_read_property() to allocate property zval too
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_API.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 52d2fd7430..d531371ded 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2612,7 +2612,7 @@ ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char * ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *name, int name_length, zend_bool silent TSRMLS_DC) { - zval property, *value; + zval *property, *value; zend_class_entry *old_scope = EG(scope); EG(scope) = scope; @@ -2624,9 +2624,10 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *n zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC); zend_error(E_CORE_ERROR, "Property %s of class %s cannot be read", name, class_name); } - ZVAL_STRINGL(&property, name, name_length, 0); - value = Z_OBJ_HT_P(object)->read_property(object, &property, silent TSRMLS_CC); - + MAKE_STD_ZVAL(property); + ZVAL_STRINGL(property, name, name_length, 1); + value = Z_OBJ_HT_P(object)->read_property(object, property, silent TSRMLS_CC); + zval_ptr_dtor(&property); EG(scope) = old_scope; return value; } |