com php-src: Merge branch 'PHP-7.0' into PHP-7.1: ext/opcache/z end_file_cache.c
[email protected] (Dmitry Stogov)
| Newsgroups | php.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: 6158b517c437e2b49f50a6807267c200492e6b74 Author: Dmitry Stogov <[email protected]> Fri, 3 Mar 2017 16:12:41 +0300 Parents: f844c0880d99bd623f95afbf832416e26b5e4ce4 648b756f35fdfc1948126ce954a3f7d6bd479ba5 Branches: PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6158b517c437e2b49f50a6807267c200492e6b74 Log: Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: Fixed file-cache (Zend/tests/unused_shared_static_variables.phpt) Changed paths: MM ext/opcache/zend_file_cache.c Diff: diff --cc ext/opcache/zend_file_cache.c index c9ae0dd,2b65685..dea427f --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@@ -359,6 -359,25 +359,25 @@@ static void zend_file_cache_serialize_o zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_zval); } + if (op_array->scope && !IS_SERIALIZED(op_array->opcodes)) { + if (UNEXPECTED(zend_shared_alloc_get_xlat_entry(op_array->opcodes))) { + op_array->refcount = (uint32_t*)(intptr_t)-1; + SERIALIZE_PTR(op_array->literals); + SERIALIZE_PTR(op_array->opcodes); + SERIALIZE_PTR(op_array->arg_info); + SERIALIZE_PTR(op_array->vars); + SERIALIZE_STR(op_array->function_name); + SERIALIZE_STR(op_array->filename); - SERIALIZE_PTR(op_array->brk_cont_array); ++ SERIALIZE_PTR(op_array->live_range); + SERIALIZE_PTR(op_array->scope); + SERIALIZE_STR(op_array->doc_comment); + SERIALIZE_PTR(op_array->try_catch_array); + SERIALIZE_PTR(op_array->prototype); + return; + } + zend_shared_alloc_register_xlat_entry(op_array->opcodes, op_array->opcodes); + } + if (op_array->literals && !IS_SERIALIZED(op_array->literals)) { zval *p, *end; @@@ -937,6 -938,22 +956,22 @@@ static void zend_file_cache_unserialize script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR); } + if (op_array->refcount) { + op_array->refcount = NULL; + UNSERIALIZE_PTR(op_array->literals); + UNSERIALIZE_PTR(op_array->opcodes); + UNSERIALIZE_PTR(op_array->arg_info); + UNSERIALIZE_PTR(op_array->vars); + UNSERIALIZE_STR(op_array->function_name); + UNSERIALIZE_STR(op_array->filename); - UNSERIALIZE_PTR(op_array->brk_cont_array); ++ UNSERIALIZE_PTR(op_array->live_range); + UNSERIALIZE_PTR(op_array->scope); + UNSERIALIZE_STR(op_array->doc_comment); + UNSERIALIZE_PTR(op_array->try_catch_array); + UNSERIALIZE_PTR(op_array->prototype); + return; + } + if (op_array->literals && !IS_UNSERIALIZED(op_array->literals)) { zval *p, *end;