@@ -821,7 +821,8 @@ static void zend_do_free(znode *op1) /* {{{ */
821
821
} else {
822
822
while (opline >= CG (active_op_array )-> opcodes ) {
823
823
if ((opline -> opcode == ZEND_FETCH_LIST_R ||
824
- opline -> opcode == ZEND_FETCH_LIST_W ) &&
824
+ opline -> opcode == ZEND_FETCH_LIST_W ||
825
+ opline -> opcode == ZEND_EXT_STMT ) &&
825
826
opline -> op1_type == IS_VAR &&
826
827
opline -> op1 .var == op1 -> u .op .var ) {
827
828
zend_emit_op (NULL , ZEND_FREE , op1 , NULL );
@@ -1920,7 +1921,7 @@ static void zend_add_to_list(void *result, void *item) /* {{{ */
1920
1921
}
1921
1922
/* }}} */
1922
1923
1923
- static void zend_do_extended_stmt (void ) /* {{{ */
1924
+ static void zend_do_extended_stmt (znode * result ) /* {{{ */
1924
1925
{
1925
1926
zend_op * opline ;
1926
1927
@@ -1931,6 +1932,9 @@ static void zend_do_extended_stmt(void) /* {{{ */
1931
1932
opline = get_next_op ();
1932
1933
1933
1934
opline -> opcode = ZEND_EXT_STMT ;
1935
+ if (result ) {
1936
+ SET_NODE (opline -> op1 , result );
1937
+ }
1934
1938
}
1935
1939
/* }}} */
1936
1940
@@ -6050,7 +6054,7 @@ static void zend_compile_for(zend_ast *ast) /* {{{ */
6050
6054
6051
6055
zend_update_jump_target_to_next (opnum_jmp );
6052
6056
zend_compile_for_expr_list (& result , cond_ast );
6053
- zend_do_extended_stmt ();
6057
+ zend_do_extended_stmt (NULL );
6054
6058
6055
6059
zend_emit_cond_jump (ZEND_JMPNZ , & result , opnum_start );
6056
6060
@@ -6171,7 +6175,7 @@ static void zend_compile_if(zend_ast *ast) /* {{{ */
6171
6175
6172
6176
if (i > 0 ) {
6173
6177
CG (zend_lineno ) = cond_ast -> lineno ;
6174
- zend_do_extended_stmt ();
6178
+ zend_do_extended_stmt (NULL );
6175
6179
}
6176
6180
6177
6181
zend_compile_expr (& cond_node , cond_ast );
@@ -6505,6 +6509,8 @@ static void zend_compile_pipe(znode *result, zend_ast *ast)
6505
6509
}
6506
6510
6507
6511
zend_compile_expr (result , fcall_ast );
6512
+ CG (zend_lineno ) = fcall_ast -> lineno ;
6513
+ zend_do_extended_stmt (result );
6508
6514
}
6509
6515
6510
6516
static void zend_compile_match (znode * result , zend_ast * ast )
@@ -8537,7 +8543,7 @@ static zend_op_array *zend_compile_func_decl_ex(
8537
8543
/* put the implicit return on the really last line */
8538
8544
CG (zend_lineno ) = decl -> end_lineno ;
8539
8545
8540
- zend_do_extended_stmt ();
8546
+ zend_do_extended_stmt (NULL );
8541
8547
zend_emit_final_return (0 );
8542
8548
8543
8549
pass_two (CG (active_op_array ));
@@ -11607,7 +11613,7 @@ static void zend_compile_stmt(zend_ast *ast) /* {{{ */
11607
11613
CG (zend_lineno ) = ast -> lineno ;
11608
11614
11609
11615
if ((CG (compiler_options ) & ZEND_COMPILE_EXTENDED_STMT ) && !zend_is_unticked_stmt (ast )) {
11610
- zend_do_extended_stmt ();
11616
+ zend_do_extended_stmt (NULL );
11611
11617
}
11612
11618
11613
11619
switch (ast -> kind ) {
0 commit comments