summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2013-07-21 16:19:13 +0800
committerXinchen Hui <laruence@php.net>2013-07-21 16:19:13 +0800
commit629965abe20b9d4ed4a793570791c983e705aa49 (patch)
tree95528dad8317ccb1ca0a83c60c6b6a8f39ec49ee /Zend/zend_builtin_functions.c
parent3363e04fb48088cb6873ab79d993e556880483a3 (diff)
parentcc91fbe986c208c40b50af8154373693d4bd7c9b (diff)
downloadphp-git-629965abe20b9d4ed4a793570791c983e705aa49.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 47fb4d2d9b..383f5333e5 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1911,6 +1911,11 @@ static int add_constant_info(zend_constant *constant, void *arg TSRMLS_DC)
zval *name_array = (zval *)arg;
zval *const_val;
+ if (!constant->name) {
+ /* skip special constants */
+ return 0;
+ }
+
MAKE_STD_ZVAL(const_val);
*const_val = constant->value;
zval_copy_ctor(const_val);
@@ -1978,11 +1983,16 @@ ZEND_FUNCTION(get_defined_constants)
while (zend_hash_get_current_data_ex(EG(zend_constants), (void **) &val, &pos) != FAILURE) {
zval *const_val;
+ if (!val->name) {
+ /* skip special constants */
+ goto next_constant;
+ }
+
if (val->module_number == PHP_USER_CONSTANT) {
module_number = i;
} else if (val->module_number > i || val->module_number < 0) {
/* should not happen */
- goto bad_module_id;
+ goto next_constant;
} else {
module_number = val->module_number;
}
@@ -1999,7 +2009,7 @@ ZEND_FUNCTION(get_defined_constants)
INIT_PZVAL(const_val);
add_assoc_zval_ex(modules[module_number], val->name, val->name_len, const_val);
-bad_module_id:
+next_constant:
zend_hash_move_forward_ex(EG(zend_constants), &pos);
}
efree(module_names);