From dcf249004c3eea72b3405b3829b7f912fb4c6492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Wed, 18 Oct 2006 16:35:15 +0000 Subject: - MFH: Fix #38465 (ReflectionParameter fails if default value is an access to self:: --- Zend/zend_constants.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Zend/zend_constants.c') diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index ec3e1e587a..08de962cd6 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -213,7 +213,7 @@ ZEND_API void zend_register_string_constant(char *name, uint name_len, char *str } -ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC) +ZEND_API int zend_get_constant_ex(char *name, uint name_len, zval *result, zend_class_entry *scope TSRMLS_DC) { zend_constant *c; int retval = 1; @@ -222,17 +222,19 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC if ((colon = memchr(name, ':', name_len)) && colon[1] == ':') { /* class constant */ - zend_class_entry **ce = NULL, *scope; + zend_class_entry **ce = NULL; int class_name_len = colon-name; int const_name_len = name_len - class_name_len - 2; char *constant_name = colon+2; zval **ret_constant; char *class_name; - if (EG(in_execution)) { - scope = EG(scope); - } else { - scope = CG(active_class_entry); + if (!scope) { + if (EG(in_execution)) { + scope = EG(scope); + } else { + scope = CG(active_class_entry); + } } class_name = estrndup(name, class_name_len); @@ -300,6 +302,10 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC return retval; } +ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC) +{ + zend_get_constant_ex(name, name_len, result, NULL TSRMLS_CC); +} ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) { -- cgit v1.2.1