com php-src: Prevent usage in GC after free.: Zend/zend_compi le.c
| From: | Dmitry Stogov | Date: | Mon, 18 Apr 2016 22:31:49 +0000 |
| Subject: | com php-src: Prevent usage in GC after free.: Zend/zend_compi le.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91783@lists.php.net to get a copy of this message | ||
Commit: ffc697ac27377df3f295c7dc7281b578759645cb
Author: Dmitry Stogov <dmitry@zend.com> Tue, 19 Apr 2016 01:31:49 +0300
Parents: 3a16f511d910a903b7172aa899312b69fbe4fdf3
Branches: PHP-5.6 PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ffc697ac27377df3f295c7dc7281b578759645cb
Log:
Prevent usage in GC after free.
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 2b35b4b..b8aba65 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;