diff options
| author | Ondřej Surý <ondrej@sury.org> | 2012-10-25 16:01:25 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2012-10-25 16:01:25 +0200 |
| commit | b57a2691d5b72c3894e2d4e0f945cecc6b3a1953 (patch) | |
| tree | 012a1408ce8a738d45ae429ca7d7f5389c159915 /Zend/zend.c | |
| parent | 45c0aa447e02c80bd21a23245574231a110cf5a1 (diff) | |
| download | php-upstream/5.4.8.tar.gz | |
Imported Upstream version 5.4.8upstream/5.4.8
Diffstat (limited to 'Zend/zend.c')
| -rw-r--r-- | Zend/zend.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index 18c4f1160..9ab879a2a 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -258,6 +258,9 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop { TSRMLS_FETCH(); + if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) { + break; + } if (Z_OBJ_HANDLER_P(expr, cast_object)) { zval *val; @@ -270,12 +273,6 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop } zval_ptr_dtor(&val); } - /* Standard PHP objects */ - if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HANDLER_P(expr, cast_object)) { - if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - break; - } - } if (!Z_OBJ_HANDLER_P(expr, cast_object) && Z_OBJ_HANDLER_P(expr, get)) { zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC); @@ -1031,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: |
