summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 6ec0e2d1c8..ec624a5adb 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -148,6 +148,15 @@ ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce)
ZEND_MAP_PTR_SET(ce->static_members_table, NULL);
while (p != end) {
+ if (UNEXPECTED(Z_ISREF_P(p))) {
+ zend_property_info *prop_info;
+ ZEND_REF_FOREACH_TYPE_SOURCES(Z_REF_P(p), prop_info) {
+ if (prop_info->ce == ce && p - static_members == prop_info->offset) {
+ ZEND_REF_DEL_TYPE_SOURCE(Z_REF_P(p), prop_info);
+ break; /* stop iteration here, the array might be realloc()'ed */
+ }
+ } ZEND_REF_FOREACH_TYPE_SOURCES_END();
+ }
i_zval_ptr_dtor(p);
p++;
}
@@ -247,6 +256,15 @@ ZEND_API void destroy_zend_class(zval *zv)
zval *end = p + ce->default_static_members_count;
while (p != end) {
+ if (UNEXPECTED(Z_ISREF_P(p))) {
+ zend_property_info *prop_info;
+ ZEND_REF_FOREACH_TYPE_SOURCES(Z_REF_P(p), prop_info) {
+ if (prop_info->ce == ce && p - ce->default_static_members_table == prop_info->offset) {
+ ZEND_REF_DEL_TYPE_SOURCE(Z_REF_P(p), prop_info);
+ break; /* stop iteration here, the array might be realloc()'ed */
+ }
+ } ZEND_REF_FOREACH_TYPE_SOURCES_END();
+ }
i_zval_ptr_dtor(p);
p++;
}
@@ -258,6 +276,9 @@ ZEND_API void destroy_zend_class(zval *zv)
if (prop_info->doc_comment) {
zend_string_release_ex(prop_info->doc_comment, 0);
}
+ if (ZEND_TYPE_IS_NAME(prop_info->type)) {
+ zend_string_release(ZEND_TYPE_NAME(prop_info->type));
+ }
}
} ZEND_HASH_FOREACH_END();
zend_hash_destroy(&ce->properties_info);
@@ -353,6 +374,9 @@ ZEND_API void destroy_zend_class(zval *zv)
if (ce->num_interfaces > 0) {
free(ce->interfaces);
}
+ if (ce->properties_info_table) {
+ free(ce->properties_info_table);
+ }
free(ce);
break;
}