summaryrefslogtreecommitdiff
path: root/ext/opcache/zend_file_cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/opcache/zend_file_cache.c')
-rw-r--r--ext/opcache/zend_file_cache.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c
index 4c7611d36d..884ee796e0 100644
--- a/ext/opcache/zend_file_cache.c
+++ b/ext/opcache/zend_file_cache.c
@@ -637,12 +637,12 @@ static void zend_file_cache_serialize_func(zval *zv,
zend_file_cache_metainfo *info,
void *buf)
{
- zend_op_array *op_array;
-
+ zend_function *func;
SERIALIZE_PTR(Z_PTR_P(zv));
- op_array = Z_PTR_P(zv);
- UNSERIALIZE_PTR(op_array);
- zend_file_cache_serialize_op_array(op_array, script, info, buf);
+ func = Z_PTR_P(zv);
+ UNSERIALIZE_PTR(func);
+ ZEND_ASSERT(func->type == ZEND_USER_FUNCTION);
+ zend_file_cache_serialize_op_array(&func->op_array, script, info, buf);
}
static void zend_file_cache_serialize_prop_info(zval *zv,
@@ -844,6 +844,14 @@ static void zend_file_cache_serialize_class(zval *zv,
}
}
+ if (ce->backed_enum_table) {
+ HashTable *ht;
+ SERIALIZE_PTR(ce->backed_enum_table);
+ ht = ce->backed_enum_table;
+ UNSERIALIZE_PTR(ht);
+ zend_file_cache_serialize_hash(ht, script, info, buf, zend_file_cache_serialize_zval);
+ }
+
SERIALIZE_PTR(ce->constructor);
SERIALIZE_PTR(ce->destructor);
SERIALIZE_PTR(ce->clone);
@@ -1432,11 +1440,11 @@ static void zend_file_cache_unserialize_func(zval *zv,
zend_persistent_script *script,
void *buf)
{
- zend_op_array *op_array;
-
+ zend_function *func;
UNSERIALIZE_PTR(Z_PTR_P(zv));
- op_array = Z_PTR_P(zv);
- zend_file_cache_unserialize_op_array(op_array, script, buf);
+ func = Z_PTR_P(zv);
+ ZEND_ASSERT(func->type == ZEND_USER_FUNCTION);
+ zend_file_cache_unserialize_op_array(&func->op_array, script, buf);
}
static void zend_file_cache_unserialize_prop_info(zval *zv,
@@ -1615,6 +1623,12 @@ static void zend_file_cache_unserialize_class(zval *zv,
}
}
+ if (ce->backed_enum_table) {
+ UNSERIALIZE_PTR(ce->backed_enum_table);
+ zend_file_cache_unserialize_hash(
+ ce->backed_enum_table, script, buf, zend_file_cache_unserialize_zval, ZVAL_PTR_DTOR);
+ }
+
UNSERIALIZE_PTR(ce->constructor);
UNSERIALIZE_PTR(ce->destructor);
UNSERIALIZE_PTR(ce->clone);