summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Greene <jason@php.net>2002-08-14 01:40:59 +0000
committerJason Greene <jason@php.net>2002-08-14 01:40:59 +0000
commitb806a8e247e0ff869b4f8f35a9ab9effd2f44a7a (patch)
tree1327efe561dcaf3edd3b50fd5bcd34498fc8ac1c
parent14a8c395afa13e515f1913f51d1a497795618321 (diff)
downloadphp-git-b806a8e247e0ff869b4f8f35a9ab9effd2f44a7a.tar.gz
MFZE1 (use token instead of global for opcode counting)
-rw-r--r--Zend/zend_compile.c5
-rw-r--r--Zend/zend_compile.h2
-rw-r--r--Zend/zend_globals.h1
-rw-r--r--Zend/zend_language_parser.y2
4 files changed, 4 insertions, 6 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 1561c2b9bf..bb7403b0c2 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2857,7 +2857,6 @@ void zend_do_foreach_end(znode *foreach_token, znode *open_brackets_token TSRMLS
void zend_do_declare_begin(TSRMLS_D)
{
zend_stack_push(&CG(declare_stack), &CG(declarables), sizeof(zend_declarables));
- CG(declarables).beginop = get_next_op_number(CG(active_op_array));
}
@@ -2873,13 +2872,13 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC)
}
-void zend_do_declare_end(TSRMLS_D)
+void zend_do_declare_end(znode *declare_token TSRMLS_DC)
{
zend_declarables *declarables;
zend_stack_top(&CG(declare_stack), (void **) &declarables);
/* We should restore if there was more than (current - start) - (ticks?1:0) opcodes */
- if ((get_next_op_number(CG(active_op_array)) - CG(declarables).beginop) - ((CG(declarables).ticks.value.lval)?1:0)) {
+ if ((get_next_op_number(CG(active_op_array)) - declare_token->u.opline_num) - ((CG(declarables).ticks.value.lval)?1:0)) {
CG(declarables) = *declarables;
}
}
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 90e99d7b03..69f98864d7 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -366,7 +366,7 @@ void zend_do_foreach_end(znode *foreach_token, znode *open_brackets_token TSRMLS
void zend_do_declare_begin(TSRMLS_D);
void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC);
-void zend_do_declare_end(TSRMLS_D);
+void zend_do_declare_end(znode *declare_token TSRMLS_DC);
void zend_do_end_heredoc(TSRMLS_D);
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h
index 969222e082..fa9cde9cf1 100644
--- a/Zend/zend_globals.h
+++ b/Zend/zend_globals.h
@@ -58,7 +58,6 @@ END_EXTERN_C()
typedef struct _zend_declarables {
zval ticks;
- zend_uint beginop;
} zend_declarables;
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index b90339bf3d..099e6f45d3 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -207,7 +207,7 @@ unticked_statement:
| T_UNSET '(' unset_variables ')' ';'
| T_FOREACH '(' variable T_AS { zend_do_foreach_begin(&$1, &$3, &$2, &$4, 1 TSRMLS_CC); } w_variable foreach_optional_arg ')' { zend_do_foreach_cont(&$6, &$7, &$4 TSRMLS_CC); } foreach_statement { zend_do_foreach_end(&$1, &$2 TSRMLS_CC); }
| T_FOREACH '(' expr_without_variable T_AS { zend_do_foreach_begin(&$1, &$3, &$2, &$4, 0 TSRMLS_CC); } w_variable foreach_optional_arg ')' { zend_do_foreach_cont(&$6, &$7, &$4 TSRMLS_CC); } foreach_statement { zend_do_foreach_end(&$1, &$2 TSRMLS_CC); }
- | T_DECLARE { zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(TSRMLS_C); }
+ | T_DECLARE { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(&$1 TSRMLS_CC); }
| ';' /* empty statement */
| T_TRY { zend_do_try(&$1 TSRMLS_CC); } '{' inner_statement_list '}'
T_CATCH '(' catch_or_import_class_entry T_VARIABLE ')' { zend_do_begin_catch(&$1, &$8, &$9, 1 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }