From 252870d4a85f942107e7b51f9bdf5fae4e88f728 Mon Sep 17 00:00:00 2001 From: Martijn Otto Date: Fri, 20 May 2016 13:38:56 +0200 Subject: Fix exception catching and properly handle casting functions returning something other than a Php::Value --- zend/origexception.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'zend/origexception.h') diff --git a/zend/origexception.h b/zend/origexception.h index f997608..fb873bd 100644 --- a/zend/origexception.h +++ b/zend/origexception.h @@ -16,7 +16,7 @@ namespace Php { /** * Class definition */ -class OrigException : public Value, public Exception +class OrigException : public Exception { private: /** @@ -42,10 +42,9 @@ private: public: /** * Constructor - * @param val + * @param object The object that was thrown */ - OrigException(zval *val TSRMLS_DC) : - Value(val), Exception("OrigException") + OrigException(zend_object *object) : Exception(std::string{ ZSTR_VAL(object->ce->name), ZSTR_LEN(object->ce->name) }) { #ifdef ZTS // copy tsrm_ls @@ -58,7 +57,7 @@ public: * @param exception */ OrigException(const OrigException &exception) : - Value(exception), Exception("OrigException"), _handled(exception._handled) + Exception("OrigException"), _handled(exception._handled) { #ifdef ZTS // copy tsrm_ls @@ -71,7 +70,7 @@ public: * @param exception */ OrigException(OrigException &&exception) : - Value(std::move(exception)), Exception("OrigException"), _handled(exception._handled) + Exception("OrigException"), _handled(exception._handled) { // set other exception to handled so that it wont do anything on destruction exception._handled = true; -- cgit v1.2.3