summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2012-09-06 11:26:40 +0400
committerDmitry Stogov <dmitry@zend.com>2012-09-06 11:26:40 +0400
commitb29dc146b9311c14186c14bcb1c8ae5288b65d73 (patch)
tree89037500c785747e5a860580a8ccffa3c5e0c84e /Zend/zend.c
parent94582f93986cfb5a43feb047bc914a0a029286d2 (diff)
downloadphp-git-b29dc146b9311c14186c14bcb1c8ae5288b65d73.tar.gz
- Fixed bug #61767 (Shutdown functions not called in certain error situation)
- Fixed bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function)
Diffstat (limited to 'Zend/zend.c')
-rw-r--r--Zend/zend.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index ea32346dae..bd53d55183 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -997,6 +997,29 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
zend_stack labels_stack;
TSRMLS_FETCH();
+ /* Report about uncaught exception in case of fatal errors */
+ if (EG(exception)) {
+ switch (type) {
+ case E_CORE_ERROR:
+ case E_ERROR:
+ case E_RECOVERABLE_ERROR:
+ case E_PARSE:
+ case E_COMPILE_ERROR:
+ case E_USER_ERROR:
+ if (zend_is_executing(TSRMLS_C)) {
+ error_lineno = zend_get_executed_lineno(TSRMLS_C);
+ }
+ zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
+ EG(exception) = NULL;
+ if (zend_is_executing(TSRMLS_C) && EG(opline_ptr)) {
+ active_opline->lineno = error_lineno;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
/* Obtain relevant filename and lineno */
switch (type) {
case E_CORE_ERROR: