Browse Source

Fixed Zend/tests/try/bug70228_3.phpt and Zend/tests/try/bug70228_4.phpt

pull/1920/head
Dmitry Stogov 10 years ago
parent
commit
da5c727499
  1. 8
      Zend/zend_vm_def.h
  2. 8
      Zend/zend_vm_execute.h

8
Zend/zend_vm_def.h

@ -7555,6 +7555,9 @@ ZEND_VM_HANDLER(159, ZEND_DISCARD_EXCEPTION, ANY, TRY_CATCH)
zend_try_catch_element *try_catch = EX(func)->op_array.try_catch_array + try_catch_offset;
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[try_catch->finally_end].op1.var);
if (try_catch->finally_op && try_catch->finally_op > opline - EX(func)->op_array.opcodes) {
break;
}
if (Z_OBJ_P(fast_call) != NULL) {
/* discard the previously thrown exception */
OBJ_RELEASE(Z_OBJ_P(fast_call));
@ -7585,6 +7588,11 @@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, TRY_CATCH)
if (fast_call->u2.lineno != (uint32_t)-1) {
const zend_op *fast_ret = EX(func)->op_array.opcodes + fast_call->u2.lineno;
if (Z_OBJ_P(fast_call)) {
OBJ_RELEASE(Z_OBJ_P(fast_call));
Z_OBJ_P(fast_call) = NULL;
}
ZEND_VM_SET_OPCODE(fast_ret + 1);
ZEND_VM_CONTINUE();
} else {

8
Zend/zend_vm_execute.h

@ -1834,6 +1834,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DISCARD_EXCEPTION_SPEC_HANDLER
zend_try_catch_element *try_catch = EX(func)->op_array.try_catch_array + try_catch_offset;
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[try_catch->finally_end].op1.var);
if (try_catch->finally_op && try_catch->finally_op > opline - EX(func)->op_array.opcodes) {
break;
}
if (Z_OBJ_P(fast_call) != NULL) {
/* discard the previously thrown exception */
OBJ_RELEASE(Z_OBJ_P(fast_call));
@ -1864,6 +1867,11 @@ 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 (Z_OBJ_P(fast_call)) {
OBJ_RELEASE(Z_OBJ_P(fast_call));
Z_OBJ_P(fast_call) = NULL;
}
ZEND_VM_SET_OPCODE(fast_ret + 1);
ZEND_VM_CONTINUE();
} else {

Loading…
Cancel
Save