com php-src: Remove FAST_CALL_FROM_CATCH: Zend/zend _compile.h Zend/zend_opcode.c Zend/zend_vm_def .h Zend/zend_vm_execute.h sapi/phpdbg/phpdbg_opco
de.c
| From: | Nikita Popov | Date: | Tue, 21 Jul 2015 19:13:34 +0000 |
| Subject: | com php-src: Remove FAST_CALL_FROM_CATCH: Zend/zend _compile.h Zend/zend_opcode.c Zend/zend_vm_def .h Zend/zend_vm_execute.h sapi/phpdbg/phpdbg_opco de.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88105@lists.php.net to get a copy of this message | ||
Commit: 7c661bd30408c4acbd623ee310e468b4e2bb97bb
Author: Nikita Popov <nikic@php.net> Tue, 21 Jul 2015 18:06:19 +0200
Parents: 2141ab9be5c2b07c24534552753f8227473efa07
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7c661bd30408c4acbd623ee310e468b4e2bb97bb
Log:
Remove FAST_CALL_FROM_CATCH
This was generated for a return from a try block with both a catch
and a finally. However at this point no exception can be active,
because it either didn't exist in the first place or was explicitly
discarded using DISCARD_EXCEPTION.
Changed paths:
M Zend/zend_compile.h
M Zend/zend_opcode.c
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
M sapi/phpdbg/phpdbg_opcode.c
Diff:
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 59ae7c9..06796aa 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -945,8 +945,7 @@ static zend_always_inline int zend_check_arg_send_type(const zend_function *zf,
#define ZEND_FAST_RET_TO_CATCH 1
#define ZEND_FAST_RET_TO_FINALLY 2
-#define ZEND_FAST_CALL_FROM_CATCH 1
-#define ZEND_FAST_CALL_FROM_FINALLY 2
+#define ZEND_FAST_CALL_FROM_FINALLY 1
#define ZEND_ARRAY_ELEMENT_REF (1<<0)
#define ZEND_ARRAY_NOT_PACKED (1<<1)
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 62b58b4..6286937 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -587,21 +587,7 @@ static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num,
zend_adjust_fast_call(op_array, start_op,
op_array->try_catch_array[i].finally_op,
op_array->try_catch_array[i].finally_end);
- if (op_array->try_catch_array[i].catch_op) {
- opline->extended_value = ZEND_FAST_CALL_FROM_CATCH;
- opline->op2.opline_num = op_array->try_catch_array[i].catch_op;
- opline->op1.opline_num = get_next_op_number(op_array);
- /* generate a FAST_CALL to hole CALL_FROM_FINALLY */
- opline = get_next_op(op_array);
- opline->opcode = ZEND_FAST_CALL;
- opline->result_type = IS_TMP_VAR;
- opline->result.var = fast_call_var;
- SET_UNUSED(opline->op1);
- SET_UNUSED(opline->op2);
- zend_resolve_fast_call(op_array, start_op + 1, op_array->try_catch_array[i].finally_op - 2);
- } else {
- zend_resolve_fast_call(op_array, start_op, op_array->try_catch_array[i].finally_op - 2);
- }
+ zend_resolve_fast_call(op_array, start_op, op_array->try_catch_array[i].finally_op - 2);
opline->op1.opline_num = op_array->try_catch_array[i].finally_op;
/* generate a sequence of FAST_CALL to upward finally block */
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 8a6cd78..ac59219 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -7492,12 +7492,6 @@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY)
USE_OPLINE
zval *fast_call = EX_VAR(opline->result.var);
- if ((opline->extended_value & ZEND_FAST_CALL_FROM_CATCH) &&
- UNEXPECTED(EG(prev_exception) != NULL)) {
- /* in case of unhandled exception jump to catch block instead of finally */
- ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
- ZEND_VM_CONTINUE();
- }
if (opline->extended_value == ZEND_FAST_CALL_FROM_FINALLY &&
UNEXPECTED(Z_OBJ_P(fast_call) != NULL)) {
fast_call->u2.lineno = (uint32_t)-1;
} else {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 2be1016..9b4d210 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1609,12 +1609,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL
ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OP
USE_OPLINE
zval *fast_call = EX_VAR(opline->result.var);
- if ((opline->extended_value & ZEND_FAST_CALL_FROM_CATCH) &&
- UNEXPECTED(EG(prev_exception) != NULL)) {
- /* in case of unhandled exception jump to catch block instead of finally */
- ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
- ZEND_VM_CONTINUE();
- }
if (opline->extended_value == ZEND_FAST_CALL_FROM_FINALLY &&
UNEXPECTED(Z_OBJ_P(fast_call) != NULL)) {
fast_call->u2.lineno = (uint32_t)-1;
} else {
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c
index 75c91e0..b8a0dfe 100644
--- a/sapi/phpdbg/phpdbg_opcode.c
+++ b/sapi/phpdbg/phpdbg_opcode.c
@@ -68,9 +68,8 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op) /*{{{ */
/* EX */
switch (op->opcode) {
case ZEND_FAST_CALL:
- if (op->extended_value != 0) {
- spprintf(&decode[0], 0, "FAST_CALL<%s>",
- op->extended_value == ZEND_FAST_CALL_FROM_CATCH ? "FROM_CATCH" :
"FROM_FINALLY");
+ if (op->extended_value == ZEND_FAST_CALL_FROM_FINALLY) {
+ decode[0] = estrdup("FAST_CALL<FROM_FINALLY>");
}
break;
case ZEND_FAST_RET: