diff options
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r-- | Zend/zend_builtin_functions.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index f29676bac..04f4ebec2 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1399,15 +1399,8 @@ ZEND_FUNCTION(class_alias) return; } - if (!autoload) { - lc_name = do_alloca(class_name_len + 1, use_heap); - zend_str_tolower_copy(lc_name, class_name, class_name_len); + found = zend_lookup_class_ex(class_name, class_name_len, NULL, autoload, &ce TSRMLS_CC); - found = zend_hash_find(EG(class_table), lc_name, class_name_len+1, (void **) &ce); - free_alloca(lc_name, use_heap); - } else { - found = zend_lookup_class(class_name, class_name_len, &ce TSRMLS_CC); - } if (found == SUCCESS) { if ((*ce)->type == ZEND_USER_CLASS) { if (zend_register_class_alias_ex(alias_name, alias_name_len, *ce TSRMLS_CC) == SUCCESS) { @@ -1926,6 +1919,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); @@ -1993,11 +1991,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; } @@ -2014,7 +2017,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); @@ -2386,7 +2389,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int MAKE_STD_ZVAL(arg_array); array_init(arg_array); - /* include_filename always points to the last filename of the last last called-fuction. + /* include_filename always points to the last filename of the last last called-function. if we have called include in the frame above - this is the file we have included. */ |