-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix memory leak of doc blocks of static properties #12238
Conversation
When declaring the same static property with a doc block in a class and in a trait, the doc block of the property in the class is leaked. This fixes php#12207.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise, thank you!
* class comment | ||
*/ | ||
static $property; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please close the PHP block. This makes tests directly executable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: 29afa07
Zend/zend_API.c
Outdated
@@ -4350,6 +4353,9 @@ ZEND_API zend_property_info *zend_declare_typed_property(zend_class_entry *ce, z | |||
(property_info_ptr->flags & ZEND_ACC_STATIC) == 0) { | |||
property_info->offset = property_info_ptr->offset; | |||
zval_ptr_dtor(&ce->default_properties_table[OBJ_PROP_TO_NUM(property_info->offset)]); | |||
if (property_info_ptr->doc_comment) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent via tab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry 🙈 Fixed: bf6cb25
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you ! |
When declaring the same static property with a doc block in a class and in a trait, the doc block of the property in the class is leaked.
This fixes #12207.