summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-07-18 15:52:52 +0800
committerXinchen Hui <laruence@php.net>2014-07-18 16:25:43 +0800
commit110bf9c720d02b49a1a5d0c6e8affe65f9aa01db (patch)
tree9d377d071e33efcbbc3c60f3218a557216edfd71 /Zend/zend_opcode.c
parent4e378844abbfbc7fec88d063ee0bf2e9026b6b6a (diff)
parentf6f621ef69a5a9bf20e94c2714bdebae73860927 (diff)
downloadphp-git-110bf9c720d02b49a1a5d0c6e8affe65f9aa01db.tar.gz
Merge remote-tracking branch 'origin/master' into phpng
Conflicts: Zend/zend_compile.h ext/openssl/xp_ssl.c
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 41cfb8904a..2f0f0aeecd 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -509,7 +509,7 @@ static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num,
SET_UNUSED(opline->op2);
opline->op1.opline_num = op_array->try_catch_array[i].finally_op;
if (op_array->try_catch_array[i].catch_op) {
- opline->extended_value = 1;
+ opline->extended_value = ZEND_FAST_CALL_FOR_CATCH;
opline->op2.opline_num = op_array->try_catch_array[i].catch_op;
}
@@ -574,6 +574,26 @@ static void zend_resolve_finally_ret(zend_op_array *op_array, zend_uint op_num T
}
}
+static void zend_resolve_fast_call(zend_op_array *op_array, zend_uint op_num TSRMLS_DC)
+{
+ int i;
+ zend_uint finally_op_num = 0;
+
+ for (i = 0; i < op_array->last_try_catch; i++) {
+ if (op_array->try_catch_array[i].finally_op > op_num) {
+ break;
+ }
+ if (op_num < op_array->try_catch_array[i].finally_end) {
+ finally_op_num = op_array->try_catch_array[i].finally_op;
+ }
+ }
+
+ if (finally_op_num) {
+ op_array->opcodes[op_num].extended_value = ZEND_FAST_CALL_FOR_FINALLY;
+ op_array->opcodes[op_num].op2.opline_num = finally_op_num - 2; /* it must be ZEND_FAST_CALL */
+ }
+}
+
static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
{
zend_uint i;
@@ -615,6 +635,9 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
case ZEND_JMP:
zend_resolve_finally_call(op_array, i, opline->op1.opline_num TSRMLS_CC);
break;
+ case ZEND_FAST_CALL:
+ zend_resolve_fast_call(op_array, i TSRMLS_CC);
+ break;
case ZEND_FAST_RET:
zend_resolve_finally_ret(op_array, i TSRMLS_CC);
break;