summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r--Zend/zend_exceptions.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index f457b2846..14ae75e38 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -85,12 +85,12 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
{
#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
- char *classname;
- int name_len;
+ const char *classname;
+ zend_uint name_len;
if (exception != NULL) {
zend_get_object_classname(exception, &classname, &name_len TSRMLS_CC);
- DTRACE_EXCEPTION_THROWN(classname);
+ DTRACE_EXCEPTION_THROWN((char *)classname);
} else {
DTRACE_EXCEPTION_THROWN(NULL);
}
@@ -817,6 +817,10 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
file = zend_read_property(default_exception_ce, EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
+
+ convert_to_string(file);
+ file = (Z_STRLEN_P(file) > 0) ? file : NULL;
+ line = (Z_TYPE_P(line) == IS_LONG) ? line : NULL;
} else {
file = NULL;
line = NULL;
@@ -828,7 +832,11 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
- zend_error_va(severity, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
+ convert_to_string(str);
+ convert_to_string(file);
+ convert_to_long(line);
+
+ zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
} else {
zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
}