diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2013-02-18 16:20:49 +0400 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2013-02-18 16:20:49 +0400 |
| commit | d77eb411ea5d80379ee92a908f543b91fa293383 (patch) | |
| tree | 8061e5b3e21fcf046ceaeb036c935429db47f349 /Zend/zend_compile.c | |
| parent | 91538e4e13908a8cfcb25c5286e4222ef4077a7e (diff) | |
| parent | 42437dd870de28eee6c9127f4c7e7c78ba8e0152 (diff) | |
| download | php-git-d77eb411ea5d80379ee92a908f543b91fa293383.tar.gz | |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
Fixed bug #64070 (Inheritance with Traits failed with error)
Conflicts:
NEWS
Zend/zend_compile.c
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 1a8d108900..701151106a 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3975,7 +3975,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, overriden = va_arg(args, HashTable**); exclude_table = va_arg(args, HashTable*); - fnname_len = strlen(fn->common.function_name); + fnname_len = hash_key->nKeyLength - 1; /* apply aliases which are qualified with a class name, there should not be any ambiguity */ if (ce->trait_aliases) { @@ -3986,7 +3986,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, if (alias->alias != NULL && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce) && alias->trait_method->mname_len == fnname_len - && (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) { + && (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, hash_key->arKey, fnname_len) == 0)) { fn_copy = *fn; /* if it is 0, no modifieres has been changed */ @@ -4008,7 +4008,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, } } - lcname = zend_str_tolower_dup(fn->common.function_name, fnname_len); + lcname = hash_key->arKey; if (exclude_table == NULL || zend_hash_find(exclude_table, lcname, fnname_len, &dummy) == FAILURE) { /* is not in hashtable, thus, function is not to be excluded */ @@ -4023,7 +4023,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, if (alias->alias == NULL && alias->modifiers != 0 && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce) && (alias->trait_method->mname_len == fnname_len) - && (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) { + && (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, lcname, fnname_len) == 0)) { fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK)); @@ -4040,8 +4040,6 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, zend_add_trait_method(ce, fn->common.function_name, lcname, fnname_len+1, &fn_copy, overriden TSRMLS_CC); } - efree(lcname); - return ZEND_HASH_APPLY_KEEP; } /* }}} */ |
