Skip to content

Commit f896b98

Browse files
committed
Exclude trait methods from call-graph
1 parent 392f0ab commit f896b98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/opcache/Optimizer/zend_optimizer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,9 @@ zend_function *zend_optimizer_get_called_func(
844844
case ZEND_INIT_METHOD_CALL:
845845
if (opline->op1_type == IS_UNUSED
846846
&& opline->op2_type == IS_CONST && Z_TYPE_P(CRT_CONSTANT(opline->op2)) == IS_STRING
847-
&& op_array->scope && !(op_array->scope->ce_flags & ZEND_ACC_TRAIT)) {
847+
&& op_array->scope
848+
&& !(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE)
849+
&& !(op_array->scope->ce_flags & ZEND_ACC_TRAIT)) {
848850
zend_string *method_name = Z_STR_P(CRT_CONSTANT(opline->op2) + 1);
849851
zend_function *fbc = zend_hash_find_ptr(
850852
&op_array->scope->function_table, method_name);

0 commit comments

Comments
 (0)