Skip to content

Commit 310fe9f

Browse files
committed
fixup! Support first-class callables in const-expressions
1 parent 9800bc9 commit 310fe9f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ext/opcache/zend_persist.c

+3
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ static zend_ast *zend_persist_ast(zend_ast *ast)
192192
zend_ast_zval *copy = zend_shared_memdup(ast, sizeof(zend_ast_zval));
193193
zend_persist_op_array(&copy->val);
194194
node = (zend_ast *) copy;
195+
} else if (ast->kind == ZEND_AST_CALLABLE_CONVERT) {
196+
zend_ast_fcc *copy = zend_shared_memdup(ast, sizeof(zend_ast_fcc));
197+
node = (zend_ast *) copy;
195198
} else {
196199
uint32_t children = zend_ast_get_num_children(ast);
197200
node = zend_shared_memdup(ast, zend_ast_size(children));

ext/opcache/zend_persist_calc.c

+2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ static void zend_persist_ast_calc(zend_ast *ast)
8989
} else if (ast->kind == ZEND_AST_OP_ARRAY) {
9090
ADD_SIZE(sizeof(zend_ast_zval));
9191
zend_persist_op_array_calc(&((zend_ast_zval*)(ast))->val);
92+
} else if (ast->kind == ZEND_AST_CALLABLE_CONVERT) {
93+
ADD_SIZE(sizeof(zend_ast_fcc));
9294
} else {
9395
uint32_t children = zend_ast_get_num_children(ast);
9496
ADD_SIZE(zend_ast_size(children));

0 commit comments

Comments
 (0)