diff options
Diffstat (limited to 'Zend/zend_exceptions.c')
| -rw-r--r-- | Zend/zend_exceptions.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index f226a09552..15eb21433f 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -26,6 +26,7 @@ #include "zend_builtin_functions.h" #include "zend_interfaces.h" #include "zend_exceptions.h" +#include "zend_vm.h" zend_class_entry *default_exception_ce; zend_class_entry *error_exception_ce; @@ -55,7 +56,7 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */ return; } EG(opline_before_exception) = EG(current_execute_data)->opline; - EG(current_execute_data)->opline = &EG(active_op_array)->opcodes[EG(active_op_array)->last-1-1]; + EG(current_execute_data)->opline = EG(exception_op); } /* }}} */ @@ -567,6 +568,23 @@ void zend_register_default_exception(TSRMLS_D) /* {{{ */ { zend_class_entry ce; + memset(EG(exception_op), 0, sizeof(EG(exception_op))); + EG(exception_op)[0].opcode = ZEND_HANDLE_EXCEPTION; + EG(exception_op)[0].op1.op_type = IS_UNUSED; + EG(exception_op)[0].op2.op_type = IS_UNUSED; + EG(exception_op)[0].result.op_type = IS_UNUSED; + ZEND_VM_SET_OPCODE_HANDLER(EG(exception_op)); + EG(exception_op)[1].opcode = ZEND_HANDLE_EXCEPTION; + EG(exception_op)[1].op1.op_type = IS_UNUSED; + EG(exception_op)[1].op2.op_type = IS_UNUSED; + EG(exception_op)[1].result.op_type = IS_UNUSED; + ZEND_VM_SET_OPCODE_HANDLER(EG(exception_op)+1); + EG(exception_op)[2].opcode = ZEND_HANDLE_EXCEPTION; + EG(exception_op)[2].op1.op_type = IS_UNUSED; + EG(exception_op)[2].op2.op_type = IS_UNUSED; + EG(exception_op)[2].result.op_type = IS_UNUSED; + ZEND_VM_SET_OPCODE_HANDLER(EG(exception_op)+2); + INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions); default_exception_ce = zend_register_internal_class(&ce TSRMLS_CC); default_exception_ce->create_object = zend_default_exception_new; |
