diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-11-15 19:54:19 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-11-15 19:54:19 +0300 |
commit | 0f7f1498be549f5988bf9d8150f35bedf70741c5 (patch) | |
tree | b9cada88f6a43fbcf2b1316ed8386a3249b0fa4a /Zend/zend_exceptions.c | |
parent | 8f2f80668e6988ac8907920d177e531a98dcb8b0 (diff) | |
download | php-git-0f7f1498be549f5988bf9d8150f35bedf70741c5.tar.gz |
Use ZEND_THIS macro to hide implementation details in extensions code.
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r-- | Zend/zend_exceptions.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index a0f644a07f..8330aba632 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -270,7 +270,7 @@ ZEND_METHOD(exception, __construct) zend_class_entry *base_ce; int argc = ZEND_NUM_ARGS(); - object = &EX(This); + object = ZEND_THIS; base_ce = i_get_exception_base(object); if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|SlO!", &message, &code, &previous, zend_ce_throwable) == FAILURE) { @@ -314,7 +314,7 @@ ZEND_METHOD(exception, __construct) ZEND_METHOD(exception, __wakeup) { zval value, *pvalue; - zval *object = &EX(This); + zval *object = ZEND_THIS; CHECK_EXC_TYPE(ZEND_STR_MESSAGE, IS_STRING); CHECK_EXC_TYPE(ZEND_STR_STRING, IS_STRING); CHECK_EXC_TYPE(ZEND_STR_CODE, IS_LONG); @@ -353,7 +353,7 @@ ZEND_METHOD(error_exception, __construct) return; } - object = &EX(This); + object = ZEND_THIS; if (message) { ZVAL_STR_COPY(&tmp, message); @@ -404,7 +404,7 @@ ZEND_METHOD(exception, getFile) DEFAULT_0_PARAMS; - ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_FILE)); + ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_FILE)); } /* }}} */ @@ -416,7 +416,7 @@ ZEND_METHOD(exception, getLine) DEFAULT_0_PARAMS; - ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_LINE)); + ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_LINE)); } /* }}} */ @@ -428,7 +428,7 @@ ZEND_METHOD(exception, getMessage) DEFAULT_0_PARAMS; - ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_MESSAGE)); + ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_MESSAGE)); } /* }}} */ @@ -440,7 +440,7 @@ ZEND_METHOD(exception, getCode) DEFAULT_0_PARAMS; - ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_CODE)); + ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_CODE)); } /* }}} */ @@ -452,7 +452,7 @@ ZEND_METHOD(exception, getTrace) DEFAULT_0_PARAMS; - ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_TRACE)); + ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_TRACE)); } /* }}} */ @@ -464,7 +464,7 @@ ZEND_METHOD(error_exception, getSeverity) DEFAULT_0_PARAMS; - ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_SEVERITY)); + ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_SEVERITY)); } /* }}} */ @@ -610,7 +610,7 @@ ZEND_METHOD(exception, getTraceAsString) DEFAULT_0_PARAMS; - object = &EX(This); + object = ZEND_THIS; base_ce = i_get_exception_base(object); trace = zend_read_property_ex(base_ce, object, ZSTR_KNOWN(ZEND_STR_TRACE), 1, &rv); @@ -643,7 +643,7 @@ ZEND_METHOD(exception, getPrevious) DEFAULT_0_PARAMS; - ZVAL_COPY(return_value, GET_PROPERTY_SILENT(&EX(This), ZEND_STR_PREVIOUS)); + ZVAL_COPY(return_value, GET_PROPERTY_SILENT(ZEND_THIS, ZEND_STR_PREVIOUS)); } /* }}} */ /* {{{ proto string Exception|Error::__toString() @@ -661,7 +661,7 @@ ZEND_METHOD(exception, __toString) str = ZSTR_EMPTY_ALLOC(); - exception = &EX(This); + exception = ZEND_THIS; fname = zend_string_init("gettraceasstring", sizeof("gettraceasstring")-1, 0); while (exception && Z_TYPE_P(exception) == IS_OBJECT && instanceof_function(Z_OBJCE_P(exception), zend_ce_throwable)) { @@ -718,7 +718,7 @@ ZEND_METHOD(exception, __toString) } zend_string_release_ex(fname, 0); - exception = &EX(This); + exception = ZEND_THIS; /* Reset apply counts */ while (exception && Z_TYPE_P(exception) == IS_OBJECT && (base_ce = i_get_exception_base(exception)) && instanceof_function(Z_OBJCE_P(exception), base_ce)) { if (Z_IS_RECURSIVE_P(exception)) { @@ -729,7 +729,7 @@ ZEND_METHOD(exception, __toString) exception = GET_PROPERTY(exception, ZEND_STR_PREVIOUS); } - exception = &EX(This); + exception = ZEND_THIS; base_ce = i_get_exception_base(exception); /* We store the result in the private property string so we can access |