com php-src: Verious fixes: Zend/zend_compile.c
| From: | Nikita Popov | Date: | Sat, 12 Jul 2014 14:25:47 +0000 |
| Subject: | com php-src: Verious fixes: Zend/zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81005@lists.php.net to get a copy of this message | ||
Commit: 86a1cd0d82827d3900e06e7aceaac2b19208413e
Author: Nikita Popov <nikic@php.net> Sat, 12 Jul 2014 16:25:47 +0200
Parents: 8577f58e525b285e816691668ea714b5b1fc78bc
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=86a1cd0d82827d3900e06e7aceaac2b19208413e
Log:
Verious fixes
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 7e36b97..933ac8f 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -7206,7 +7206,7 @@ void zend_compile_foreach(zend_ast *ast TSRMLS_DC) {
opnum_reset = get_next_op_number(CG(active_op_array));
opline = emit_op(&reset_node, ZEND_FE_RESET, &expr_node, NULL TSRMLS_CC);
if (by_ref && is_variable) {
- opline->extended_value = ZEND_FE_RESET_VARIABLE; // ???
+ opline->extended_value = ZEND_FE_RESET_VARIABLE | ZEND_FE_RESET_REFERENCE; // ???
}
SET_NODE(foreach_stack_opline.result, &reset_node);
@@ -7444,7 +7444,9 @@ void zend_compile_try(zend_ast *ast TSRMLS_DC) {
}
opnum_catch = get_next_op_number(CG(active_op_array));
- zend_add_catch_element(try_catch_offset, opnum_catch TSRMLS_CC);
+ if (i == 0) {
+ CG(active_op_array)->try_catch_array[try_catch_offset].catch_op = opnum_catch;
+ }
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_CATCH;
@@ -7452,7 +7454,7 @@ void zend_compile_try(zend_ast *ast TSRMLS_DC) {
opline->op1.constant = zend_add_class_name_literal(
CG(active_op_array), &class_node.u.constant TSRMLS_CC);
opline->op2_type = IS_CV;
- opline->op2.var = lookup_cv(CG(active_op_array), Z_STR_P(var_name) TSRMLS_CC);
+ opline->op2.var = lookup_cv(CG(active_op_array), STR_COPY(Z_STR_P(var_name)) TSRMLS_CC);
opline->result.num = (i == ast->children - 1); /* Whether this is the last catch */
zend_compile_stmt(stmt_ast TSRMLS_CC);