Skip to content

Commit ffc697a

Browse files
committed
Prevent usage in GC after free.
1 parent 3a16f51 commit ffc697a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Zend/zend_compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3669,7 +3669,8 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
36693669
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
36703670
zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
36713671
} else if ((child_info->flags & ZEND_ACC_STATIC) == 0) {
3672-
zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset]));
3672+
/* Don't keep default properties in GC (thry may be freed by opcache) */
3673+
i_zval_ptr_dtor_nogc(ce->default_properties_table[parent_info->offset] ZEND_FILE_LINE_CC TSRMLS_CC);
36733674
ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset];
36743675
ce->default_properties_table[child_info->offset] = NULL;
36753676
child_info->offset = parent_info->offset;

0 commit comments

Comments
 (0)