diff options
author | Marcus Boerger <helly@php.net> | 2004-11-24 19:56:54 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-11-24 19:56:54 +0000 |
commit | 520097b065341943363cf9ee968d78213a8d0e57 (patch) | |
tree | 67fae3a64616b83eeb0dad46dd720f91a13d89ed /ext/reflection/php_reflection.c | |
parent | 4ab537fc613182dd10caec0dd2fc3c1d3bfc5e36 (diff) | |
download | php-git-520097b065341943363cf9ee968d78213a8d0e57.tar.gz |
- Fix Bug #30856 (ReflectionClass::getStaticProperties segfaults)
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 771d4101a4..73da40d62e 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2295,6 +2295,13 @@ 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; + } + 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 *)); } |