diff options
Diffstat (limited to 'Zend/zend.c')
-rw-r--r-- | Zend/zend.c | 23 |
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: |