Skip to content

Commit bec80b3

Browse files
committed
Don't try to modify the method prototype
1 parent ca149dd commit bec80b3

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
@@ -868,15 +868,15 @@ static zend_always_inline inheritance_status do_inheritance_check_on_method_ex(z
868868
parent = proto;
869869
}
870870

871-
if (!check_only && child->common.prototype != proto) {
871+
if (!check_only && child->common.prototype != proto && child_zv) {
872872
do {
873873
if (child->common.scope != ce
874874
&& child->type == ZEND_USER_FUNCTION
875875
&& !child->op_array.static_variables) {
876876
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
877877
/* Few parent interfaces contain the same method */
878878
break;
879-
} else if (child_zv) {
879+
} else {
880880
/* op_array wasn't duplicated yet */
881881
zend_function *new_function = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
882882
memcpy(new_function, child, sizeof(zend_op_array));
@@ -1593,7 +1593,6 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
15931593
/* Abstract method signatures from the trait must be satisfied. */
15941594
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
15951595
do_inheritance_check_on_method(existing_fn, fn, ce, NULL);
1596-
fn->common.prototype = NULL;
15971596
return;
15981597
}
15991598

@@ -1616,7 +1615,6 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
16161615
/* inherited members are overridden by members inserted by traits */
16171616
/* check whether the trait method fulfills the inheritance requirements */
16181617
do_inheritance_check_on_method(fn, existing_fn, ce, NULL);
1619-
fn->common.prototype = NULL;
16201618
}
16211619
}
16221620

0 commit comments

Comments
 (0)