Skip to content

Commit e46be0c

Browse files
committed
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6: Prevent usage in GC after free.
2 parents 73958ca + ffc697a commit e46be0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Zend/zend_inheritance.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,8 @@ static void do_inherit_property(zend_property_info *parent_info, zend_string *ke
657657
int parent_num = OBJ_PROP_TO_NUM(parent_info->offset);
658658
int child_num = OBJ_PROP_TO_NUM(child_info->offset);
659659

660-
zval_ptr_dtor(&(ce->default_properties_table[parent_num]));
660+
/* Don't keep default properties in GC (thry may be freed by opcache) */
661+
zval_ptr_dtor_nogc(&(ce->default_properties_table[parent_num]));
661662
ce->default_properties_table[parent_num] = ce->default_properties_table[child_num];
662663
ZVAL_UNDEF(&ce->default_properties_table[child_num]);
663664
child_info->offset = parent_info->offset;

0 commit comments

Comments
 (0)