@@ -710,7 +710,7 @@ void zend_stop_lexing(void)
710
710
}
711
711
712
712
static inline void zend_begin_loop (
713
- uint8_t free_opcode , const znode * loop_var , zend_brk_cont_kind kind ) /* {{{ */
713
+ uint8_t free_opcode , const znode * loop_var , bool is_switch ) /* {{{ */
714
714
{
715
715
zend_brk_cont_element * brk_cont_element ;
716
716
int parent = CG (context ).current_brk_cont ;
@@ -719,7 +719,7 @@ static inline void zend_begin_loop(
719
719
CG (context ).current_brk_cont = CG (context ).last_brk_cont ;
720
720
brk_cont_element = get_next_brk_cont_element ();
721
721
brk_cont_element -> parent = parent ;
722
- brk_cont_element -> kind = kind ;
722
+ brk_cont_element -> is_switch = is_switch ;
723
723
724
724
uint32_t start = get_next_op_number ();
725
725
info .opcode_start = start ;
@@ -5828,8 +5828,7 @@ static void zend_compile_break_continue(zend_ast *ast) /* {{{ */
5828
5828
ZEND_ASSERT (cur != -1 );
5829
5829
}
5830
5830
5831
- if (CG (context ).brk_cont_array [cur ].kind == ZEND_BRK_CONT_KIND_SWITCH_MATCH_STMT
5832
- || CG (context ).brk_cont_array [cur ].kind == ZEND_BRK_CONT_KIND_MATCH_EXPR ) {
5831
+ if (CG (context ).brk_cont_array [cur ].is_switch ) {
5833
5832
if (depth == 1 ) {
5834
5833
if (CG (context ).brk_cont_array [cur ].parent == -1 ) {
5835
5834
zend_error (E_WARNING ,
@@ -5967,7 +5966,7 @@ static void zend_compile_while(zend_ast *ast) /* {{{ */
5967
5966
5968
5967
opnum_jmp = zend_emit_jump (0 );
5969
5968
5970
- zend_begin_loop (ZEND_NOP , NULL , ZEND_BRK_CONT_KIND_LOOP );
5969
+ zend_begin_loop (ZEND_NOP , NULL , 0 );
5971
5970
5972
5971
opnum_start = get_next_op_number ();
5973
5972
zend_compile_stmt (stmt_ast );
@@ -5990,7 +5989,7 @@ static void zend_compile_do_while(zend_ast *ast) /* {{{ */
5990
5989
znode cond_node ;
5991
5990
uint32_t opnum_start , opnum_cond ;
5992
5991
5993
- zend_begin_loop (ZEND_NOP , NULL , ZEND_BRK_CONT_KIND_LOOP );
5992
+ zend_begin_loop (ZEND_NOP , NULL , 0 );
5994
5993
5995
5994
opnum_start = get_next_op_number ();
5996
5995
zend_compile_stmt (stmt_ast );
@@ -6041,7 +6040,7 @@ static void zend_compile_for(zend_ast *ast) /* {{{ */
6041
6040
6042
6041
opnum_jmp = zend_emit_jump (0 );
6043
6042
6044
- zend_begin_loop (ZEND_NOP , NULL , ZEND_BRK_CONT_KIND_LOOP );
6043
+ zend_begin_loop (ZEND_NOP , NULL , 0 );
6045
6044
6046
6045
opnum_start = get_next_op_number ();
6047
6046
zend_compile_stmt (stmt_ast );
@@ -6103,7 +6102,7 @@ static void zend_compile_foreach(zend_ast *ast) /* {{{ */
6103
6102
opnum_reset = get_next_op_number ();
6104
6103
opline = zend_emit_op (& reset_node , by_ref ? ZEND_FE_RESET_RW : ZEND_FE_RESET_R , & expr_node , NULL );
6105
6104
6106
- zend_begin_loop (ZEND_FE_FREE , & reset_node , ZEND_BRK_CONT_KIND_LOOP );
6105
+ zend_begin_loop (ZEND_FE_FREE , & reset_node , 0 );
6107
6106
6108
6107
opnum_fetch = get_next_op_number ();
6109
6108
opline = zend_emit_op (NULL , by_ref ? ZEND_FE_FETCH_RW : ZEND_FE_FETCH_R , & reset_node , NULL );
@@ -6276,7 +6275,7 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */
6276
6275
6277
6276
zend_compile_expr (& expr_node , expr_ast );
6278
6277
6279
- zend_begin_loop (ZEND_FREE , & expr_node , ZEND_BRK_CONT_KIND_SWITCH_MATCH_STMT );
6278
+ zend_begin_loop (ZEND_FREE , & expr_node , 1 );
6280
6279
6281
6280
case_node .op_type = IS_TMP_VAR ;
6282
6281
case_node .u .op .var = get_temporary_variable ();
@@ -6460,7 +6459,7 @@ static void zend_compile_match(znode *result, zend_ast *ast)
6460
6459
zend_stack_push (& CG (loop_var_stack ), & info );
6461
6460
}
6462
6461
6463
- zend_begin_loop (ZEND_FREE , & expr_node , result ? ZEND_BRK_CONT_KIND_MATCH_EXPR : ZEND_BRK_CONT_KIND_SWITCH_MATCH_STMT );
6462
+ zend_begin_loop (ZEND_FREE , & expr_node , /* is_switch */ true );
6464
6463
6465
6464
znode case_node ;
6466
6465
case_node .op_type = IS_TMP_VAR ;
0 commit comments