Skip to content

Commit

Permalink
fixup! Support first-class callables in const-expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWolla committed Jan 7, 2025
1 parent 9800bc9 commit 310fe9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/opcache/zend_persist.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ static zend_ast *zend_persist_ast(zend_ast *ast)
zend_ast_zval *copy = zend_shared_memdup(ast, sizeof(zend_ast_zval));
zend_persist_op_array(&copy->val);
node = (zend_ast *) copy;
} else if (ast->kind == ZEND_AST_CALLABLE_CONVERT) {
zend_ast_fcc *copy = zend_shared_memdup(ast, sizeof(zend_ast_fcc));
node = (zend_ast *) copy;
} else {
uint32_t children = zend_ast_get_num_children(ast);
node = zend_shared_memdup(ast, zend_ast_size(children));
Expand Down
2 changes: 2 additions & 0 deletions ext/opcache/zend_persist_calc.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ static void zend_persist_ast_calc(zend_ast *ast)
} else if (ast->kind == ZEND_AST_OP_ARRAY) {
ADD_SIZE(sizeof(zend_ast_zval));
zend_persist_op_array_calc(&((zend_ast_zval*)(ast))->val);
} else if (ast->kind == ZEND_AST_CALLABLE_CONVERT) {
ADD_SIZE(sizeof(zend_ast_fcc));
} else {
uint32_t children = zend_ast_get_num_children(ast);
ADD_SIZE(zend_ast_size(children));
Expand Down

0 comments on commit 310fe9f

Please sign in to comment.