@@ -821,7 +821,8 @@ static void zend_do_free(znode *op1) /* {{{ */
821821 } else {
822822 while (opline >= CG (active_op_array )-> opcodes ) {
823823 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 ) &&
825826 opline -> op1_type == IS_VAR &&
826827 opline -> op1 .var == op1 -> u .op .var ) {
827828 zend_emit_op (NULL , ZEND_FREE , op1 , NULL );
@@ -1920,7 +1921,7 @@ static void zend_add_to_list(void *result, void *item) /* {{{ */
19201921}
19211922/* }}} */
19221923
1923- static void zend_do_extended_stmt (void ) /* {{{ */
1924+ static void zend_do_extended_stmt (znode * result ) /* {{{ */
19241925{
19251926 zend_op * opline ;
19261927
@@ -1931,6 +1932,9 @@ static void zend_do_extended_stmt(void) /* {{{ */
19311932 opline = get_next_op ();
19321933
19331934 opline -> opcode = ZEND_EXT_STMT ;
1935+ if (result ) {
1936+ SET_NODE (opline -> op1 , result );
1937+ }
19341938}
19351939/* }}} */
19361940
@@ -6050,7 +6054,7 @@ static void zend_compile_for(zend_ast *ast) /* {{{ */
60506054
60516055 zend_update_jump_target_to_next (opnum_jmp );
60526056 zend_compile_for_expr_list (& result , cond_ast );
6053- zend_do_extended_stmt ();
6057+ zend_do_extended_stmt (NULL );
60546058
60556059 zend_emit_cond_jump (ZEND_JMPNZ , & result , opnum_start );
60566060
@@ -6171,7 +6175,7 @@ static void zend_compile_if(zend_ast *ast) /* {{{ */
61716175
61726176 if (i > 0 ) {
61736177 CG (zend_lineno ) = cond_ast -> lineno ;
6174- zend_do_extended_stmt ();
6178+ zend_do_extended_stmt (NULL );
61756179 }
61766180
61776181 zend_compile_expr (& cond_node , cond_ast );
@@ -6505,6 +6509,8 @@ static void zend_compile_pipe(znode *result, zend_ast *ast)
65056509 }
65066510
65076511 zend_compile_expr (result , fcall_ast );
6512+ CG (zend_lineno ) = fcall_ast -> lineno ;
6513+ zend_do_extended_stmt (result );
65086514}
65096515
65106516static void zend_compile_match (znode * result , zend_ast * ast )
@@ -8537,7 +8543,7 @@ static zend_op_array *zend_compile_func_decl_ex(
85378543 /* put the implicit return on the really last line */
85388544 CG (zend_lineno ) = decl -> end_lineno ;
85398545
8540- zend_do_extended_stmt ();
8546+ zend_do_extended_stmt (NULL );
85418547 zend_emit_final_return (0 );
85428548
85438549 pass_two (CG (active_op_array ));
@@ -11607,7 +11613,7 @@ static void zend_compile_stmt(zend_ast *ast) /* {{{ */
1160711613 CG (zend_lineno ) = ast -> lineno ;
1160811614
1160911615 if ((CG (compiler_options ) & ZEND_COMPILE_EXTENDED_STMT ) && !zend_is_unticked_stmt (ast )) {
11610- zend_do_extended_stmt ();
11616+ zend_do_extended_stmt (NULL );
1161111617 }
1161211618
1161311619 switch (ast -> kind ) {
0 commit comments