Skip to content

Commit c7aeb4e

Browse files
committed
Avoid forward decl
1 parent df9330c commit c7aeb4e

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

Zend/zend_compile.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6443,7 +6443,37 @@ static bool can_match_use_jumptable(zend_ast_list *arms) {
64436443
}
64446444

64456445
static void zend_compile_stmt_list(zend_ast *ast);
6446-
static void zend_compile_block_expr(znode *result, zend_ast *ast, bool omit_free_range);
6446+
6447+
static void zend_compile_block_expr(znode *result, zend_ast *ast, bool omit_free_range)
6448+
{
6449+
bool prev_in_block_expr = CG(context).in_block_expr;
6450+
CG(context).in_block_expr = true;
6451+
if (result && !omit_free_range) {
6452+
zend_loop_var info = {0};
6453+
info.opcode = ZEND_FREE_RANGE;
6454+
info.var_type = IS_UNUSED;
6455+
info.var_num = (uint32_t)-1;
6456+
info.opcode_start = get_next_op_number();
6457+
zend_stack_push(&CG(loop_var_stack), &info);
6458+
}
6459+
zend_compile_stmt_list(ast->child[0]);
6460+
zend_ast *result_expr_ast = ast->child[1];
6461+
if (result_expr_ast) {
6462+
if (result) {
6463+
zend_compile_expr(result, result_expr_ast);
6464+
} else {
6465+
zend_compile_stmt(result_expr_ast);
6466+
}
6467+
} else if (result) {
6468+
result->op_type = IS_CONST;
6469+
ZVAL_NULL(&result->u.constant);
6470+
}
6471+
if (result && !omit_free_range) {
6472+
zend_stack_del_top(&CG(loop_var_stack));
6473+
}
6474+
CG(context).in_block_expr = prev_in_block_expr;
6475+
}
6476+
64476477

64486478
static void zend_compile_match(znode *result, zend_ast *ast)
64496479
{
@@ -11418,36 +11448,6 @@ void zend_compile_top_stmt(zend_ast *ast) /* {{{ */
1141811448
}
1141911449
/* }}} */
1142011450

11421-
static void zend_compile_block_expr(znode *result, zend_ast *ast, bool omit_free_range)
11422-
{
11423-
bool prev_in_block_expr = CG(context).in_block_expr;
11424-
CG(context).in_block_expr = true;
11425-
if (result && !omit_free_range) {
11426-
zend_loop_var info = {0};
11427-
info.opcode = ZEND_FREE_RANGE;
11428-
info.var_type = IS_UNUSED;
11429-
info.var_num = (uint32_t)-1;
11430-
info.opcode_start = get_next_op_number();
11431-
zend_stack_push(&CG(loop_var_stack), &info);
11432-
}
11433-
zend_compile_stmt_list(ast->child[0]);
11434-
zend_ast *result_expr_ast = ast->child[1];
11435-
if (result_expr_ast) {
11436-
if (result) {
11437-
zend_compile_expr(result, result_expr_ast);
11438-
} else {
11439-
zend_compile_stmt(result_expr_ast);
11440-
}
11441-
} else if (result) {
11442-
result->op_type = IS_CONST;
11443-
ZVAL_NULL(&result->u.constant);
11444-
}
11445-
if (result && !omit_free_range) {
11446-
zend_stack_del_top(&CG(loop_var_stack));
11447-
}
11448-
CG(context).in_block_expr = prev_in_block_expr;
11449-
}
11450-
1145111451
static void zend_compile_stmt(zend_ast *ast) /* {{{ */
1145211452
{
1145311453
if (!ast) {

0 commit comments

Comments
 (0)