From: Dmitry Stogov Date: Wed, 16 Sep 2020 09:04:29 +0000 (+0300) Subject: Exclude trait methods from call-graph X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f896b982cce6e458c78994c61aa13473e421b919;p=php Exclude trait methods from call-graph --- diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index c71e7c040b..1c7f9aab29 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -844,7 +844,9 @@ zend_function *zend_optimizer_get_called_func( case ZEND_INIT_METHOD_CALL: if (opline->op1_type == IS_UNUSED && opline->op2_type == IS_CONST && Z_TYPE_P(CRT_CONSTANT(opline->op2)) == IS_STRING - && op_array->scope && !(op_array->scope->ce_flags & ZEND_ACC_TRAIT)) { + && op_array->scope + && !(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE) + && !(op_array->scope->ce_flags & ZEND_ACC_TRAIT)) { zend_string *method_name = Z_STR_P(CRT_CONSTANT(opline->op2) + 1); zend_function *fbc = zend_hash_find_ptr( &op_array->scope->function_table, method_name);