diff options
author | Marcus Boerger <helly@php.net> | 2005-01-22 12:23:01 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2005-01-22 12:23:01 +0000 |
commit | 1d5c13bdad8416d96f22ce1e0da9b3dfba7c8fe5 (patch) | |
tree | 3923274d9cc0325b7838089764833e34ad2895ca /ext/reflection/php_reflection.c | |
parent | bad986232bd56d920ef9edf10314ff3c02eee2ee (diff) | |
download | php-git-1d5c13bdad8416d96f22ce1e0da9b3dfba7c8fe5.tar.gz |
- Fix #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 92f5859e53..071bfec553 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2296,11 +2296,7 @@ ZEND_METHOD(reflection_class, getStaticProperties) METHOD_NOTSTATIC_NUMPARAMS(0); GET_REFLECTION_OBJECT_PTR(ce); - if (!ce->constants_updated) { - zend_hash_apply_with_argument(&ce->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - zend_hash_apply_with_argument(ce->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - ce->constants_updated = 1; - } + zend_update_class_constants(ce TSRMLS_CC); array_init(return_value); zend_hash_copy(Z_ARRVAL_P(return_value), ce->static_members, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); @@ -2319,6 +2315,8 @@ ZEND_METHOD(reflection_class, getDefaultProperties) GET_REFLECTION_OBJECT_PTR(ce); array_init(return_value); + zend_update_class_constants(ce TSRMLS_CC); + count = zend_hash_num_elements(&ce->default_properties); if (count > 0) { HashPosition pos; |