Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ext/opcache/zend_file_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,12 @@ static void zend_file_cache_serialize_ast(zend_ast *ast,
} else if (ast->kind == ZEND_AST_CALLABLE_CONVERT) {
zend_ast_fcc *fcc = (zend_ast_fcc*)ast;
ZEND_MAP_PTR_INIT(fcc->fptr, NULL);
zend_file_cache_serialize_ast(fcc->args, script, info, buf);
if (!IS_SERIALIZED(fcc->args)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be reached multiple times per AST, or does this just mirror the other branches?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mirrors the other branches, but I assume that this can be reached multiple times when the AST is referenced from multiple places. In the other branches this happens at least when serializing ast class consts, for inherited consts.

SERIALIZE_PTR(fcc->args);
tmp = fcc->args;
UNSERIALIZE_PTR(tmp);
zend_file_cache_serialize_ast(tmp, script, info, buf);
Comment on lines +388 to +391
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same logic as the generic loop bellow

}
} else if (zend_ast_is_decl(ast)) {
/* Not implemented. */
ZEND_UNREACHABLE();
Expand Down Expand Up @@ -1305,7 +1310,10 @@ static void zend_file_cache_unserialize_ast(zend_ast *ast,
} else if (ast->kind == ZEND_AST_CALLABLE_CONVERT) {
zend_ast_fcc *fcc = (zend_ast_fcc*)ast;
ZEND_MAP_PTR_NEW(fcc->fptr);
zend_file_cache_unserialize_ast(fcc->args, script, buf);
if (!IS_UNSERIALIZED(fcc->args)) {
UNSERIALIZE_PTR(fcc->args);
zend_file_cache_unserialize_ast(fcc->args, script, buf);
}
} else if (zend_ast_is_decl(ast)) {
/* Not implemented. */
ZEND_UNREACHABLE();
Expand Down
Loading