diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-07-31 10:55:39 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-07-31 10:55:39 +0400 |
commit | 534dfa84a1347f88d92fdfe58d9cd5b3ddc41462 (patch) | |
tree | 3ed85f674b6aa7f8a515c4d63f847662bd2b9e73 /ext/reflection/php_reflection.c | |
parent | 449f3e645232055760c8ccca77498f83b88f5486 (diff) | |
parent | cf5b3ed31c00040a2e0f1d5142ace3576b758c30 (diff) | |
download | php-git-534dfa84a1347f88d92fdfe58d9cd5b3ddc41462.tar.gz |
Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
Fixed getDefaultProperties (it should not return reference)
Fixed invalid free
Fixed segfault
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index f2d3059c3d..508ddceacd 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3351,16 +3351,12 @@ ZEND_METHOD(reflection_class, __construct) /* {{{ add_class_vars */ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value TSRMLS_DC) { - HashPosition pos; zend_property_info *prop_info; zval *prop, prop_copy; zend_string *key; ulong num_index; - zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos); - while ((prop_info = zend_hash_get_current_data_ptr_ex(&ce->properties_info, &pos)) != NULL) { - zend_hash_get_current_key_ex(&ce->properties_info, &key, &num_index, 0, &pos); - zend_hash_move_forward_ex(&ce->properties_info, &pos); + ZEND_HASH_FOREACH_KEY_PTR(&ce->properties_info, num_index, key, prop_info) { if (((prop_info->flags & ZEND_ACC_SHADOW) && prop_info->ce != ce) || ((prop_info->flags & ZEND_ACC_PROTECTED) && @@ -3382,6 +3378,7 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value } /* copy: enforce read only access */ + ZVAL_DEREF(prop); ZVAL_DUP(&prop_copy, prop); /* this is necessary to make it able to work with default array @@ -3391,7 +3388,7 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value } zend_hash_update(Z_ARRVAL_P(return_value), key, &prop_copy); - } + } ZEND_HASH_FOREACH_END(); } /* }}} */ |