Skip to content

Commit fce235e

Browse files
committed
fixup! Support first-class callables in const-expressions
1 parent a05bde6 commit fce235e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Zend/zend_ast.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,11 +1279,12 @@ static void* ZEND_FASTCALL zend_ast_tree_copy(zend_ast *ast, void *buf)
12791279
new->op_array = old->op_array;
12801280
buf = (void*)((char*)buf + sizeof(zend_ast_op_array));
12811281
} else if (ast->kind == ZEND_AST_CALLABLE_CONVERT) {
1282+
zend_ast_fcc *old = (zend_ast_fcc*)ast;
12821283
zend_ast_fcc *new = (zend_ast_fcc*)buf;
1283-
new->kind = ZEND_AST_CALLABLE_CONVERT;
1284-
new->attr = ast->attr;
1285-
new->lineno = ast->lineno;
1286-
new->fptr__ptr = ((zend_ast_fcc *) ast)->fptr__ptr;
1284+
new->kind = old->kind;
1285+
new->attr = old->attr;
1286+
new->lineno = old->lineno;
1287+
ZEND_MAP_PTR_INIT(new->fptr, ZEND_MAP_PTR(old->fptr));
12871288
buf = (void*)((char*)buf + sizeof(zend_ast_fcc));
12881289
} else if (zend_ast_is_decl(ast)) {
12891290
/* Not implemented. */

0 commit comments

Comments
 (0)