mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed bug #70843 (Segmentation fault on MacOSX with opcache.file_cache_only=1)
This commit is contained in:
parent
2f2653aa77
commit
fe0af271c6
2 changed files with 25 additions and 8 deletions
2
NEWS
2
NEWS
|
@ -7,6 +7,8 @@ PHP NEWS
|
|||
(Dmitry, Laruence)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #70843 (Segmentation fault on MacOSX with
|
||||
opcache.file_cache_only=1). (Laruence)
|
||||
. Fixed bug #70656 (require() statement broken after opcache_reset() or a
|
||||
few hours of use). (Laruence)
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "zend_virtual_cwd.h"
|
||||
#include "zend_compile.h"
|
||||
#include "zend_vm.h"
|
||||
#include "zend_interfaces.h"
|
||||
|
||||
#include "php.h"
|
||||
|
||||
|
@ -801,10 +802,12 @@ int zend_file_cache_script_store(zend_persistent_script *script, int in_shm)
|
|||
static void zend_file_cache_unserialize_hash(HashTable *ht,
|
||||
zend_persistent_script *script,
|
||||
void *buf,
|
||||
unserialize_callback_t func)
|
||||
unserialize_callback_t func,
|
||||
dtor_func_t dtor)
|
||||
{
|
||||
Bucket *p, *end;
|
||||
|
||||
ht->pDestructor = dtor;
|
||||
if (!(ht->u.flags & HASH_FLAG_INITIALIZED)) {
|
||||
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
|
||||
return;
|
||||
|
@ -869,7 +872,8 @@ static void zend_file_cache_unserialize_zval(zval *zv,
|
|||
|
||||
UNSERIALIZE_PTR(Z_ARR_P(zv));
|
||||
ht = Z_ARR_P(zv);
|
||||
zend_file_cache_unserialize_hash(ht, script, buf, zend_file_cache_unserialize_zval);
|
||||
zend_file_cache_unserialize_hash(ht,
|
||||
script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR);
|
||||
}
|
||||
break;
|
||||
case IS_REFERENCE:
|
||||
|
@ -904,7 +908,8 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
|
|||
|
||||
UNSERIALIZE_PTR(op_array->static_variables);
|
||||
ht = op_array->static_variables;
|
||||
zend_file_cache_unserialize_hash(ht, script, buf, zend_file_cache_unserialize_zval);
|
||||
zend_file_cache_unserialize_hash(ht,
|
||||
script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR);
|
||||
}
|
||||
|
||||
if (op_array->literals && !IS_UNSERIALIZED(op_array->literals)) {
|
||||
|
@ -1056,7 +1061,8 @@ static void zend_file_cache_unserialize_class(zval *zv,
|
|||
ce = Z_PTR_P(zv);
|
||||
|
||||
UNSERIALIZE_STR(ce->name);
|
||||
zend_file_cache_unserialize_hash(&ce->function_table, script, buf, zend_file_cache_unserialize_func);
|
||||
zend_file_cache_unserialize_hash(&ce->function_table,
|
||||
script, buf, zend_file_cache_unserialize_func, ZEND_FUNCTION_DTOR);
|
||||
if (ce->default_properties_table) {
|
||||
zval *p, *end;
|
||||
|
||||
|
@ -1079,10 +1085,12 @@ static void zend_file_cache_unserialize_class(zval *zv,
|
|||
p++;
|
||||
}
|
||||
}
|
||||
zend_file_cache_unserialize_hash(&ce->constants_table, script, buf, zend_file_cache_unserialize_zval);
|
||||
zend_file_cache_unserialize_hash(&ce->constants_table,
|
||||
script, buf, zend_file_cache_unserialize_zval, NULL);
|
||||
UNSERIALIZE_STR(ZEND_CE_FILENAME(ce));
|
||||
UNSERIALIZE_STR(ZEND_CE_DOC_COMMENT(ce));
|
||||
zend_file_cache_unserialize_hash(&ce->properties_info, script, buf, zend_file_cache_unserialize_prop_info);
|
||||
zend_file_cache_unserialize_hash(&ce->properties_info,
|
||||
script, buf, zend_file_cache_unserialize_prop_info, ZVAL_PTR_DTOR);
|
||||
|
||||
if (ce->trait_aliases) {
|
||||
zend_trait_alias **p, *q;
|
||||
|
@ -1168,6 +1176,11 @@ static void zend_file_cache_unserialize_class(zval *zv,
|
|||
UNSERIALIZE_PTR(ce->__tostring);
|
||||
UNSERIALIZE_PTR(ce->__callstatic);
|
||||
UNSERIALIZE_PTR(ce->__debugInfo);
|
||||
|
||||
if (UNEXPECTED((ce->ce_flags & ZEND_ACC_ANON_CLASS))) {
|
||||
ce->serialize = zend_class_serialize_deny;
|
||||
ce->unserialize = zend_class_unserialize_deny;
|
||||
}
|
||||
}
|
||||
|
||||
static void zend_file_cache_unserialize(zend_persistent_script *script,
|
||||
|
@ -1177,8 +1190,10 @@ static void zend_file_cache_unserialize(zend_persistent_script *script,
|
|||
|
||||
UNSERIALIZE_STR(script->full_path);
|
||||
|
||||
zend_file_cache_unserialize_hash(&script->class_table, script, buf, zend_file_cache_unserialize_class);
|
||||
zend_file_cache_unserialize_hash(&script->function_table, script, buf, zend_file_cache_unserialize_func);
|
||||
zend_file_cache_unserialize_hash(&script->class_table,
|
||||
script, buf, zend_file_cache_unserialize_class, ZEND_CLASS_DTOR);
|
||||
zend_file_cache_unserialize_hash(&script->function_table,
|
||||
script, buf, zend_file_cache_unserialize_func, ZEND_FUNCTION_DTOR);
|
||||
zend_file_cache_unserialize_op_array(&script->main_op_array, script, buf);
|
||||
|
||||
UNSERIALIZE_PTR(script->arena_mem);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue