Skip to content

Commit 576baec

Browse files
committed
Don't try to modify the method prototype
1 parent e8a05c4 commit 576baec

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Zend/zend_inheritance.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,15 +842,15 @@ static zend_always_inline inheritance_status do_inheritance_check_on_method_ex(z
842842
parent = proto;
843843
}
844844

845-
if (!check_only && child->common.prototype != proto) {
845+
if (!check_only && child->common.prototype != proto && child_zv) {
846846
do {
847847
if (child->common.scope != ce
848848
&& child->type == ZEND_USER_FUNCTION
849849
&& !child->op_array.static_variables) {
850850
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
851851
/* Few parent interfaces contain the same method */
852852
break;
853-
} else if (child_zv) {
853+
} else {
854854
/* op_array wasn't duplicated yet */
855855
zend_function *new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
856856
memcpy(new_function, child, sizeof(zend_op_array));
@@ -1565,7 +1565,6 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
15651565
/* Abstract method signatures from the trait must be satisfied. */
15661566
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
15671567
do_inheritance_check_on_method(existing_fn, fn, ce, NULL);
1568-
fn->common.prototype = NULL;
15691568
return;
15701569
}
15711570

@@ -1588,7 +1587,6 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
15881587
/* inherited members are overridden by members inserted by traits */
15891588
/* check whether the trait method fulfills the inheritance requirements */
15901589
do_inheritance_check_on_method(fn, existing_fn, ce, NULL);
1591-
fn->common.prototype = NULL;
15921590
}
15931591
}
15941592

0 commit comments

Comments
 (0)