Skip to content

Commit 262f52d

Browse files
committed
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.
1 parent 2c5fcd5 commit 262f52d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Zend/zend_inheritance.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ static void zend_traits_copy_functions(zend_string *fnname, zend_function *fn, z
16971697

16981698
/* if it is 0, no modifieres has been changed */
16991699
if (alias->modifiers) {
1700-
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
1700+
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags & ~ZEND_ACC_PPP_MASK);
17011701
}
17021702

17031703
lcname = zend_string_tolower(alias->alias);
@@ -1712,8 +1712,7 @@ static void zend_traits_copy_functions(zend_string *fnname, zend_function *fn, z
17121712

17131713
if (exclude_table == NULL || zend_hash_find(exclude_table, fnname) == NULL) {
17141714
/* is not in hashtable, thus, function is not to be excluded */
1715-
/* And how about ZEND_OVERLOADED_FUNCTION? */
1716-
memcpy(&fn_copy, fn, fn->type == ZEND_USER_FUNCTION? sizeof(zend_op_array) : sizeof(zend_internal_function));
1715+
memcpy(&fn_copy, fn, fn->type == ZEND_USER_FUNCTION ? sizeof(zend_op_array) : sizeof(zend_internal_function));
17171716

17181717
/* apply aliases which have not alias name, just setting visibility */
17191718
if (ce->trait_aliases) {
@@ -1726,7 +1725,7 @@ static void zend_traits_copy_functions(zend_string *fnname, zend_function *fn, z
17261725
&& fn->common.scope == aliases[i]
17271726
&& zend_string_equals_ci(alias->trait_method.method_name, fnname)
17281727
) {
1729-
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK));
1728+
fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags & ~ZEND_ACC_PPP_MASK);
17301729
}
17311730
alias_ptr++;
17321731
alias = *alias_ptr;

0 commit comments

Comments
 (0)