Skip to content

Commit

Permalink
Fix Opcache file cache
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWolla committed Dec 2, 2024
1 parent 1310748 commit 94f42ef
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions ext/opcache/zend_file_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,6 @@ static void zend_file_cache_serialize_hash(HashTable *ht,
}
}

static void zend_file_cache_serialize_func(zval *zv,
zend_persistent_script *script,
zend_file_cache_metainfo *info,
void *buf);

static void zend_file_cache_serialize_ast(zend_ast *ast,
zend_persistent_script *script,
zend_file_cache_metainfo *info,
Expand All @@ -369,7 +364,8 @@ static void zend_file_cache_serialize_ast(zend_ast *ast,
}
}
} else if (ast->kind == ZEND_AST_OP_ARRAY) {
zend_file_cache_serialize_func(&((zend_ast_zval*)ast)->val, script, info, buf);
/* The op_array itself will be serialized as part of the dynamic_func_defs. */
SERIALIZE_PTR(Z_PTR(((zend_ast_zval*)ast)->val));
} else {
uint32_t children = zend_ast_get_num_children(ast);
for (i = 0; i < children; i++) {
Expand Down Expand Up @@ -475,7 +471,7 @@ static void zend_file_cache_serialize_op_array(zend_op_array *op_arra

/* Check whether this op_array has already been serialized. */
if (IS_SERIALIZED(op_array->opcodes)) {
// ZEND_ASSERT(op_array->scope && "Only method op_arrays should be shared");
ZEND_ASSERT(op_array->scope && "Only method op_arrays should be shared");
return;
}

Expand Down Expand Up @@ -1233,10 +1229,6 @@ static void zend_file_cache_unserialize_hash(HashTable *ht,
}
}

static void zend_file_cache_unserialize_func(zval *zv,
zend_persistent_script *script,
void *buf);

static void zend_file_cache_unserialize_ast(zend_ast *ast,
zend_persistent_script *script,
void *buf)
Expand All @@ -1254,7 +1246,8 @@ static void zend_file_cache_unserialize_ast(zend_ast *ast,
}
}
} else if (ast->kind == ZEND_AST_OP_ARRAY) {
zend_file_cache_unserialize_func(&((zend_ast_zval*)ast)->val, script, buf);
/* The op_array itself will be unserialized as part of the dynamic_func_defs. */
UNSERIALIZE_PTR(Z_PTR(((zend_ast_zval*)ast)->val));
} else {
uint32_t children = zend_ast_get_num_children(ast);
for (i = 0; i < children; i++) {
Expand Down Expand Up @@ -1368,7 +1361,7 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr

/* Check whether this op_array has already been unserialized. */
if (IS_UNSERIALIZED(op_array->opcodes)) {
//ZEND_ASSERT(op_array->scope && "Only method op_arrays should be shared");
ZEND_ASSERT(op_array->scope && "Only method op_arrays should be shared");
return;
}

Expand Down

0 comments on commit 94f42ef

Please # to comment.