cataphract Thu, 03 Feb 2011 12:45:30 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=307971
Log: - Simpler fix for bug #53915. Bug: http://bugs.php.net/53915 (Assigned) ReflectionClass::getConstants emits fatal error on selfreferencing constants. Changed paths: U php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c U php/php-src/trunk/ext/reflection/php_reflection.c Modified: php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c 2011-02-03 12:38:25 UTC (rev 307970) +++ php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c 2011-02-03 12:45:30 UTC (rev 307971) @@ -3731,11 +3731,6 @@ } /* }}} */ -static int _update_constant_ex_cb_wrapper(void *pDest, void *ce TSRMLS_DC) -{ - return zval_update_constant_ex(pDest, (void*)(zend_uintptr_t)1U, ce); -} - /* {{{ proto public array ReflectionClass::getConstants() Returns an associative array containing this class' constants and their values */ ZEND_METHOD(reflection_class, getConstants) @@ -3749,7 +3744,7 @@ } GET_REFLECTION_OBJECT_PTR(ce); array_init(return_value); - zend_hash_apply_with_argument(&ce->constants_table, _update_constant_ex_cb_wrapper, ce TSRMLS_CC); + zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce TSRMLS_CC); zend_hash_copy(Z_ARRVAL_P(return_value), &ce->constants_table, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); } /* }}} */ @@ -3770,7 +3765,7 @@ } GET_REFLECTION_OBJECT_PTR(ce); - zend_hash_apply_with_argument(&ce->constants_table, _update_constant_ex_cb_wrapper, ce TSRMLS_CC); + zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce TSRMLS_CC); if (zend_hash_find(&ce->constants_table, name, name_len + 1, (void **) &value) == FAILURE) { RETURN_FALSE; } Modified: php/php-src/trunk/ext/reflection/php_reflection.c =================================================================== --- php/php-src/trunk/ext/reflection/php_reflection.c 2011-02-03 12:38:25 UTC (rev 307970) +++ php/php-src/trunk/ext/reflection/php_reflection.c 2011-02-03 12:45:30 UTC (rev 307971) @@ -3973,11 +3973,6 @@ } /* }}} */ -static int _update_constant_ex_cb_wrapper(void *pDest, void *ce TSRMLS_DC) -{ - return zval_update_constant_ex(pDest, (void*)(zend_uintptr_t)1U, ce); -} - /* {{{ proto public array ReflectionClass::getConstants() Returns an associative array containing this class' constants and their values */ ZEND_METHOD(reflection_class, getConstants) @@ -3991,7 +3986,7 @@ } GET_REFLECTION_OBJECT_PTR(ce); array_init(return_value); - zend_hash_apply_with_argument(&ce->constants_table, _update_constant_ex_cb_wrapper, ce TSRMLS_CC); + zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce TSRMLS_CC); zend_hash_copy(Z_ARRVAL_P(return_value), &ce->constants_table, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); } /* }}} */ @@ -4012,7 +4007,7 @@ } GET_REFLECTION_OBJECT_PTR(ce); - zend_hash_apply_with_argument(&ce->constants_table, _update_constant_ex_cb_wrapper, ce TSRMLS_CC); + zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce TSRMLS_CC); if (zend_hash_find(&ce->constants_table, name, name_len + 1, (void **) &value) == FAILURE) { RETURN_FALSE; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php