summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2012-09-06 12:14:29 +0400
committerDmitry Stogov <dmitry@zend.com>2012-09-06 12:14:29 +0400
commit6ba376f552238de643a665d355fd5e59c40315b5 (patch)
treed5a066fee542d75ea1c369a8eba1b5caa8f48c72 /Zend/zend.c
parenta43c45ea7d354179df91a59795faa0bcbceb1812 (diff)
parentb29dc146b9311c14186c14bcb1c8ae5288b65d73 (diff)
downloadphp-git-6ba376f552238de643a665d355fd5e59c40315b5.tar.gz
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: - Fixed bug #61767 (Shutdown functions not called in certain error situation) - Fixed bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function) Conflicts: NEWS Zend/zend_object_handlers.c
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 09338e7f83..9ab879a2a4 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -1028,6 +1028,29 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
zend_stack context_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: