Skip to content
Merged
Changes from 1 commit
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
15 changes: 10 additions & 5 deletions Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,7 @@ static void zend_add_to_list(void *result, void *item) /* {{{ */
}
/* }}} */

static void zend_do_extended_stmt(void) /* {{{ */
static void zend_do_extended_stmt(znode* result) /* {{{ */
{
zend_op *opline;

Expand All @@ -1931,6 +1931,9 @@ static void zend_do_extended_stmt(void) /* {{{ */
opline = get_next_op();

opline->opcode = ZEND_EXT_STMT;
if (result) {
SET_NODE(opline->op1, result);
}
}
/* }}} */

Expand Down Expand Up @@ -6050,7 +6053,7 @@ static void zend_compile_for(zend_ast *ast) /* {{{ */

zend_update_jump_target_to_next(opnum_jmp);
zend_compile_for_expr_list(&result, cond_ast);
zend_do_extended_stmt();
zend_do_extended_stmt(NULL);

zend_emit_cond_jump(ZEND_JMPNZ, &result, opnum_start);

Expand Down Expand Up @@ -6171,7 +6174,7 @@ static void zend_compile_if(zend_ast *ast) /* {{{ */

if (i > 0) {
CG(zend_lineno) = cond_ast->lineno;
zend_do_extended_stmt();
zend_do_extended_stmt(NULL);
}

zend_compile_expr(&cond_node, cond_ast);
Expand Down Expand Up @@ -6500,6 +6503,8 @@ static void zend_compile_pipe(znode *result, zend_ast *ast)
}

zend_compile_expr(result, fcall_ast);
CG(zend_lineno) = fcall_ast->lineno;
zend_do_extended_stmt(result);
}

static void zend_compile_match(znode *result, zend_ast *ast)
Expand Down Expand Up @@ -8532,7 +8537,7 @@ static zend_op_array *zend_compile_func_decl_ex(
/* put the implicit return on the really last line */
CG(zend_lineno) = decl->end_lineno;

zend_do_extended_stmt();
zend_do_extended_stmt(NULL);
zend_emit_final_return(0);

pass_two(CG(active_op_array));
Expand Down Expand Up @@ -11602,7 +11607,7 @@ static void zend_compile_stmt(zend_ast *ast) /* {{{ */
CG(zend_lineno) = ast->lineno;

if ((CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT) && !zend_is_unticked_stmt(ast)) {
zend_do_extended_stmt();
zend_do_extended_stmt(NULL);
}

switch (ast->kind) {
Expand Down