Skip to content

Commit 8893c0b

Browse files
committed
Copy function attributes in function_copy_ctor()
1 parent a4678c0 commit 8893c0b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Zend/zend.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,15 @@ static void function_copy_ctor(zval *zv) /* {{{ */
665665
}
666666
func->common.arg_info = new_arg_info + 1;
667667
}
668+
if (old_func->common.attributes) {
669+
zend_attribute *attr;
670+
671+
func->common.attributes = NULL;
672+
673+
ZEND_HASH_PACKED_FOREACH_PTR(old_func->common.attributes, attr) {
674+
zend_add_attribute(&func->common.attributes, attr->name, attr->argc, attr->flags, attr->offset, attr->lineno);
675+
} ZEND_HASH_FOREACH_END();
676+
}
668677
}
669678
/* }}} */
670679

0 commit comments

Comments
 (0)