From 9ace33b9c5d06b869b2aec577b119b0494840931 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 21 Aug 2018 17:40:06 +0100 Subject: Fix #76773 - Methods with a concrete scope need to be added again --- Zend/zend_inheritance.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Zend/zend_inheritance.c') diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 8af409f191..d692f3410c 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -1178,10 +1178,11 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s zend_function *new_fn; if ((existing_fn = zend_hash_find_ptr(&ce->function_table, key)) != NULL) { - /* if it is the same function with the same visibility regardless of where it is coming from */ - /* there is no conflict and we do not need to add it again */ + /* if it is the same function with the same visibility and has not been assigned a class scope yet, regardless + * of where it is coming from there is no conflict and we do not need to add it again */ if (existing_fn->op_array.opcodes == fn->op_array.opcodes && - (existing_fn->common.fn_flags & ZEND_ACC_PPP_MASK) == (fn->common.fn_flags & ZEND_ACC_PPP_MASK)) { + (existing_fn->common.fn_flags & ZEND_ACC_PPP_MASK) == (fn->common.fn_flags & ZEND_ACC_PPP_MASK) && + (existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { return; } -- cgit v1.2.1