summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c45
1 files changed, 19 insertions, 26 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 427f56d72e..2ebf8d403a 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2732,6 +2732,7 @@ static int zend_add_try_element(zend_uint try_op TSRMLS_DC) /* {{{ */
CG(active_op_array)->try_catch_array = erealloc(CG(active_op_array)->try_catch_array, sizeof(zend_try_catch_element)*CG(active_op_array)->last_try_catch);
CG(active_op_array)->try_catch_array[try_catch_offset].try_op = try_op;
CG(active_op_array)->try_catch_array[try_catch_offset].finally_op = 0;
+ CG(active_op_array)->try_catch_array[try_catch_offset].finally_end = 0;
return try_catch_offset;
}
/* }}} */
@@ -2792,7 +2793,7 @@ void zend_do_try(znode *try_token TSRMLS_DC) /* {{{ */
/* }}} */
void zend_do_finally(znode *finally_token TSRMLS_DC) /* {{{ */ {
- finally_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
+ finally_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
} /* }}} */
void zend_do_begin_catch(znode *catch_token, znode *class_name, znode *catch_var, znode *first_catch TSRMLS_DC) /* {{{ */
@@ -2846,34 +2847,29 @@ void zend_do_end_catch(znode *catch_token TSRMLS_DC) /* {{{ */
/* }}} */
void zend_do_bind_catch(znode *try_token, znode *catch_token TSRMLS_DC) /* {{{ */ {
- if (catch_token->op_type != IS_UNUSED) {
- zend_add_catch_element(try_token->u.op.opline_num, catch_token->EA TSRMLS_CC);
- }
+ if (catch_token->op_type != IS_UNUSED) {
+ zend_add_catch_element(try_token->u.op.opline_num, catch_token->EA TSRMLS_CC);
+ }
}
/* }}} */
-
void zend_do_end_finally(znode *try_token, znode* catch_token, znode *finally_token TSRMLS_DC) /* {{{ */
{
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
-
- if (catch_token->op_type == IS_UNUSED && finally_token->op_type == IS_UNUSED) {
- zend_error(E_COMPILE_ERROR, "Cannot use try without catch or finally");
- }
- if (finally_token->op_type != IS_UNUSED) {
- CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].finally_op = finally_token->u.op.opline_num;
- //try_token->u.op.opline_num = catch_token->u.op.opline_num;
-
- opline->opcode = ZEND_LEAVE;
- SET_UNUSED(opline->op1);
- SET_UNUSED(opline->op2);
- }
- if (catch_token->op_type == IS_UNUSED) {
- CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].catch_op = 0;
- } //else {
- // try_token->u.op.opline_num = catch_token->u.op.opline_num;
- //}
+ if (catch_token->op_type == IS_UNUSED && finally_token->op_type == IS_UNUSED) {
+ zend_error(E_COMPILE_ERROR, "Cannot use try without catch or finally");
+ }
+ if (finally_token->op_type != IS_UNUSED) {
+ zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].finally_op = finally_token->u.op.opline_num;
+ CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].finally_end = get_next_op_number(CG(active_op_array));
+ opline->opcode = ZEND_LEAVE;
+ SET_UNUSED(opline->op1);
+ SET_UNUSED(opline->op2);
+ }
+ if (catch_token->op_type == IS_UNUSED) {
+ CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].catch_op = 0;
+ }
}
/* }}} */
@@ -6823,9 +6819,6 @@ again:
case T_OPEN_TAG_WITH_ECHO:
retval = T_ECHO;
break;
- case T_END_HEREDOC:
- efree(Z_STRVAL(zendlval->u.constant));
- break;
}
INIT_PZVAL(&zendlval->u.constant);