summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-01-21 19:39:55 +0000
committerDmitry Stogov <dmitry@php.net>2008-01-21 19:39:55 +0000
commitfa47e900e28fe5dd2c408288a7d43d48cf2706fa (patch)
treeed8f9a5529c4d215884758064d69364fd7238f91 /Zend/zend_exceptions.c
parent7390459e2664346c17d10c2347a0f3b766b6ab83 (diff)
downloadphp-git-fa47e900e28fe5dd2c408288a7d43d48cf2706fa.tar.gz
Changed exception handling. Now each op_array doesn't contain ZEND_HANDLE_EXCEPTION opcode in the end
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r--Zend/zend_exceptions.c20
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;