Browse files

- Fix bug #3073. continue in do..while() loops should work now

  • Loading branch information...
1 parent a955474 commit 400ee6caa0353d8b32797dad345be6da1dd07e2f @andigutmans andigutmans committed Dec 31, 1999
Showing with 8 additions and 8 deletions.
  1. +4 −4 Zend/ZendTS.dsp
  2. +1 −1 Zend/zend-parser.y
  3. +2 −2 Zend/zend_compile.c
  4. +1 −1 Zend/zend_compile.h
View
8 Zend/ZendTS.dsp
@@ -230,6 +230,10 @@ SOURCE=.\zend_extensions.h
# End Source File
# Begin Source File
+SOURCE=.\zend_fast_cache.h
+# End Source File
+# Begin Source File
+
SOURCE=.\zend_globals.h
# End Source File
# Begin Source File
@@ -272,10 +276,6 @@ SOURCE=.\zend_stack.h
SOURCE=.\zend_variables.h
# End Source File
-# Begin Source File
-
-SOURCE=.\zend_fast_cache.h
-# End Source File
# End Group
# Begin Group "Parsers"
View
2 Zend/zend-parser.y
@@ -164,7 +164,7 @@ statement:
| T_IF '(' expr ')' { do_if_cond(&$3, &$4 CLS_CC); } statement { do_if_after_statement(&$4, 1 CLS_CC); } elseif_list else_single { do_if_end(CLS_C); }
| T_IF '(' expr ')' ':' { do_if_cond(&$3, &$4 CLS_CC); } inner_statement_list { do_if_after_statement(&$4, 1 CLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { do_if_end(CLS_C); }
| T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { do_while_cond(&$4, &$5 CLS_CC); } while_statement { do_while_end(&$1, &$5 CLS_CC); }
- | T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); do_do_while_begin(CLS_C); } statement T_WHILE '(' expr ')' ';' { do_do_while_end(&$1, &$6 CLS_CC); }
+ | T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); do_do_while_begin(CLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { do_do_while_end(&$1, &$5, &$7 CLS_CC); }
| T_FOR
'('
for_expr
View
4 Zend/zend_compile.c
@@ -1220,7 +1220,7 @@ void do_do_while_begin(CLS_D)
}
-void do_do_while_end(znode *do_token, znode *expr CLS_DC)
+void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1229,7 +1229,7 @@ void do_do_while_end(znode *do_token, znode *expr CLS_DC)
opline->op2.u.opline_num = do_token->u.opline_num;
SET_UNUSED(opline->op2);
- do_end_loop(do_token->u.opline_num CLS_CC);
+ do_end_loop(expr_open_bracket->u.opline_num CLS_CC);
DEC_BPC(CG(active_op_array));
}
View
2 Zend/zend_compile.h
@@ -237,7 +237,7 @@ ZEND_API void *get_binary_op(int opcode);
void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC);
void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC);
void do_do_while_begin(CLS_D);
-void do_do_while_end(znode *do_token, znode *expr CLS_DC);
+void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC);
void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC);

0 comments on commit 400ee6c

Please sign in to comment.