summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-12-12 10:55:32 +0300
committerDmitry Stogov <dmitry@zend.com>2016-12-12 10:55:32 +0300
commitfac95658b3201fdc7924cd3afa44a5f7afc194aa (patch)
tree2558b17ab5c03e90f34ae982c5a4a36a69562683 /Zend/zend_exceptions.h
parent32201fe5ad97251f9a33a11b2fdbd7f24382fc11 (diff)
downloadphp-git-fac95658b3201fdc7924cd3afa44a5f7afc194aa.tar.gz
Improved VM stack unwinding on exception.
Now zend_throw_exception_hook() is going to be called only when exception is actually thrown and not going to be recalled for each unwinded finction.
Diffstat (limited to 'Zend/zend_exceptions.h')
-rw-r--r--Zend/zend_exceptions.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h
index 18caf35553..71dcc8d172 100644
--- a/Zend/zend_exceptions.h
+++ b/Zend/zend_exceptions.h
@@ -72,6 +72,14 @@ ZEND_API ZEND_COLD void zend_exception_error(zend_object *exception, int severit
size_t zend_spprintf(char **message, size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
zend_string *zend_strpprintf(size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
+static zend_always_inline void zend_rethrow_exception(zend_execute_data *execute_data)
+{
+ if (EX(opline)->opcode != ZEND_HANDLE_EXCEPTION) {
+ EG(opline_before_exception) = EX(opline);
+ EX(opline) = EG(exception_op);
+ }
+}
+
END_EXTERN_C()
#endif