diff options
-rw-r--r-- | Zend/zend.c | 24 | ||||
-rw-r--r-- | Zend/zend_exceptions.c | 17 |
2 files changed, 24 insertions, 17 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index b6329e9b7c..c2cb9b4da9 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -28,6 +28,7 @@ #include "zend_exceptions.h" #include "zend_builtin_functions.h" #include "zend_ini.h" +#include "zend_vm.h" #ifdef ZTS # define GLOBAL_FUNCTION_TABLE global_function_table @@ -463,6 +464,27 @@ static void zend_set_default_compile_time_values(TSRMLS_D) /* {{{ */ } /* }}} */ +static void zend_init_exception_op(TSRMLS_D) /* {{{ */ +{ + 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); +} +/* }}} */ + #ifdef ZTS static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS_DC) /* {{{ */ { @@ -522,6 +544,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS zend_startup_constants(TSRMLS_C); zend_copy_constants(EG(zend_constants), GLOBAL_CONSTANTS_TABLE); zend_init_rsrc_plist(TSRMLS_C); + zend_init_exception_op(TSRMLS_C); EG(lambda_count) = 0; EG(user_error_handler) = NULL; EG(user_exception_handler) = NULL; @@ -680,6 +703,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i #ifndef ZTS zend_init_rsrc_plist(TSRMLS_C); + zend_init_exception_op(TSRMLS_C); #endif if (start_builtin_functions) { diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 18e3047540..6329362cd2 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -568,23 +568,6 @@ 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; |