summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-04-19 01:31:49 +0300
committerDmitry Stogov <dmitry@zend.com>2016-04-19 01:31:49 +0300
commitffc697ac27377df3f295c7dc7281b578759645cb (patch)
tree31d69f5d894ccd54c15743b9848f814d2978d6f2
parent3a16f511d910a903b7172aa899312b69fbe4fdf3 (diff)
downloadphp-git-ffc697ac27377df3f295c7dc7281b578759645cb.tar.gz
Prevent usage in GC after free.
-rw-r--r--Zend/zend_compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 2b35b4b6ef..b8aba65bcf 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3669,7 +3669,8 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
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");
} else if ((child_info->flags & ZEND_ACC_STATIC) == 0) {
- zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset]));
+ /* Don't keep default properties in GC (thry may be freed by opcache) */
+ i_zval_ptr_dtor_nogc(ce->default_properties_table[parent_info->offset] ZEND_FILE_LINE_CC TSRMLS_CC);
ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset];
ce->default_properties_table[child_info->offset] = NULL;
child_info->offset = parent_info->offset;