summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2015-08-04 23:41:00 -0700
committerStanislav Malyshev <stas@php.net>2015-08-04 23:51:55 -0700
commitfeeb2fba93a451c467ec70963995ca6371b3a568 (patch)
tree8d4cf61a99a8d953989b620e8fbb0d8b9dea30ff /Zend/zend_exceptions.c
parent6981bc32be1d31b4efe54696b6da24940566ee04 (diff)
downloadphp-git-feeb2fba93a451c467ec70963995ca6371b3a568.tar.gz
fix merge
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r--Zend/zend_exceptions.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 250db365cd..5c718cefd4 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -282,8 +282,9 @@ ZEND_METHOD(exception, __construct)
/* {{{ proto Exception::__wakeup()
Exception unserialize checks */
#define CHECK_EXC_TYPE(name, type) \
- if(zend_read_property(i_get_exception_base(object), (object), name, sizeof(name) - 1, 1, &value) != &EG(uninitialized_zval) \
- && Z_TYPE(value) != type) { \
+ ZVAL_UNDEF(&value); \
+ pvalue = zend_read_property(i_get_exception_base(object), (object), name, sizeof(name) - 1, 1, &value); \
+ if(Z_TYPE_P(pvalue) != IS_UNDEF && Z_TYPE_P(pvalue) != type) { \
zval tmp; \
ZVAL_STRINGL(&tmp, name, sizeof(name) - 1); \
Z_OBJ_HANDLER_P(object, unset_property)(object, &tmp, NULL); \
@@ -292,7 +293,7 @@ ZEND_METHOD(exception, __construct)
ZEND_METHOD(exception, __wakeup)
{
- zval value;
+ zval value, *pvalue;
zval *object = getThis();
CHECK_EXC_TYPE("message", IS_STRING);
CHECK_EXC_TYPE("string", IS_STRING);
@@ -711,7 +712,7 @@ ZEND_METHOD(exception, __toString)
exception = getThis();
ZVAL_STRINGL(&fname, "gettraceasstring", sizeof("gettraceasstring")-1);
- while (exception && Z_TYPE_P(exception) == IS_OBJECT) {
+ while (exception && Z_TYPE_P(exception) == IS_OBJECT && instanceof_function(Z_OBJCE_P(exception), zend_ce_throwable)) {
zend_string *prev_str = str;
zend_string *message = zval_get_string(GET_PROPERTY(exception, "message"));
zend_string *file = zval_get_string(GET_PROPERTY(exception, "file"));