summaryrefslogtreecommitdiff
path: root/Zend/zend_vm_execute.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-05-13 14:38:43 +0300
committerDmitry Stogov <dmitry@zend.com>2016-05-13 14:38:43 +0300
commitbe071702b30e9ba9bf9f9c9831f3301af039b1d5 (patch)
tree0c55550a9cc926c5b409b2c01bf22521265c5bf6 /Zend/zend_vm_execute.h
parente9c3f9fcde1013cc1c9bdead7e16478a108d7907 (diff)
downloadphp-git-be071702b30e9ba9bf9f9c9831f3301af039b1d5.tar.gz
Fixed bug #72188 (Nested try/finally blocks losing return value)
Diffstat (limited to 'Zend/zend_vm_execute.h')
-rw-r--r--Zend/zend_vm_execute.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 9eaff4624d..5b09255f30 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1845,9 +1845,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPC
if (fast_call->u2.lineno != (uint32_t)-1) {
const zend_op *fast_ret = EX(func)->op_array.opcodes + fast_call->u2.lineno;
- if (fast_ret->extended_value & ZEND_FAST_CALL_FROM_FINALLY) {
- fast_call->u2.lineno = EX(func)->op_array.try_catch_array[fast_ret->op2.num].finally_op - 2;
- }
ZEND_VM_SET_OPCODE(fast_ret + 1);
ZEND_VM_CONTINUE();
} else {
@@ -1856,7 +1853,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPC
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
uint32_t finally_op = EX(func)->op_array.try_catch_array[opline->op2.num].finally_op;
+ uint32_t finally_end = EX(func)->op_array.try_catch_array[opline->op2.num].finally_end;
+ zval *next_fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_end].op1.var);
+ Z_OBJ_P(next_fast_call) = Z_OBJ_P(fast_call);
+ next_fast_call->u2.lineno = (uint32_t)-1;
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, finally_op);
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op]);
ZEND_VM_CONTINUE();