summaryrefslogtreecommitdiff
path: root/Zend/zend_inheritance.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-03-03 15:00:15 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-03-03 15:00:51 +0100
commit262f52d5e2dedbc735363ddd3504190447edf3bf (patch)
tree0462c4d7d56d20fc8f6d124a55cbb1c920c16206 /Zend/zend_inheritance.c
parent2c5fcd57c0aa89a00b8caa2acaa04d7ac60a87dd (diff)
downloadphp-git-262f52d5e2dedbc735363ddd3504190447edf3bf.tar.gz
Small code cleanup
I found what the modifier code does with XOR pretty confusing. It's just removing the PPP bits... Also remove an outdated reference to OVERLOADED_FUNCTION.
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r--Zend/zend_inheritance.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index df84efc389..f15c325d67 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -1697,7 +1697,7 @@ static void zend_traits_copy_functions(zend_string *fnname, zend_function *fn, z
/* if it is 0, no modifieres has been changed */
if (alias->modifiers) {
- fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
+ fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags & ~ZEND_ACC_PPP_MASK);
}
lcname = zend_string_tolower(alias->alias);
@@ -1712,8 +1712,7 @@ static void zend_traits_copy_functions(zend_string *fnname, zend_function *fn, z
if (exclude_table == NULL || zend_hash_find(exclude_table, fnname) == NULL) {
/* is not in hashtable, thus, function is not to be excluded */
- /* And how about ZEND_OVERLOADED_FUNCTION? */
- memcpy(&fn_copy, fn, fn->type == ZEND_USER_FUNCTION? sizeof(zend_op_array) : sizeof(zend_internal_function));
+ memcpy(&fn_copy, fn, fn->type == ZEND_USER_FUNCTION ? sizeof(zend_op_array) : sizeof(zend_internal_function));
/* apply aliases which have not alias name, just setting visibility */
if (ce->trait_aliases) {
@@ -1726,7 +1725,7 @@ static void zend_traits_copy_functions(zend_string *fnname, zend_function *fn, z
&& fn->common.scope == aliases[i]
&& zend_string_equals_ci(alias->trait_method.method_name, fnname)
) {
- fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
+ fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags & ~ZEND_ACC_PPP_MASK);
}
alias_ptr++;
alias = *alias_ptr;