]> granicus.if.org Git - php/commitdiff
Exclude trait methods from call-graph
authorDmitry Stogov <dmitry@zend.com>
Wed, 16 Sep 2020 09:04:29 +0000 (12:04 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 16 Sep 2020 09:04:29 +0000 (12:04 +0300)
ext/opcache/Optimizer/zend_optimizer.c

index c71e7c040ba6a3b60d2f6e61999d9c87f285a2ff..1c7f9aab293b7f8e1f653adac95def64ef72a3ec 100644 (file)
@@ -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);