summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-08-07 15:05:24 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-08-07 16:40:27 +0200
commit7991fc2753c9c15eeccb2a6384050a21c6ffaa71 (patch)
treeaf7d05682b9acbd2694645c1041472c949f375f9 /ext
parent0400d07e613ac0e14bfceae0b5deda77062e319e (diff)
downloadphp-git-7991fc2753c9c15eeccb2a6384050a21c6ffaa71.tar.gz
Accept zend_object in zend_read_property
Diffstat (limited to 'ext')
-rw-r--r--ext/com_dotnet/com_wrapper.c2
-rw-r--r--ext/curl/curl_file.c2
-rw-r--r--ext/curl/interface.c6
-rw-r--r--ext/dom/php_dom.c7
-rw-r--r--ext/reflection/php_reflection.c2
-rw-r--r--ext/soap/php_encoding.c2
-rw-r--r--ext/soap/soap.c12
-rw-r--r--ext/sodium/libsodium.c2
-rw-r--r--ext/spl/spl_iterators.c2
9 files changed, 17 insertions, 20 deletions
diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c
index c4f41a4916..05ffb41f26 100644
--- a/ext/com_dotnet/com_wrapper.c
+++ b/ext/com_dotnet/com_wrapper.c
@@ -278,7 +278,7 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
* and expose it as a COM exception */
if (wFlags & DISPATCH_PROPERTYGET) {
- retval = zend_read_property(Z_OBJCE(disp->object), &disp->object, Z_STRVAL_P(name), Z_STRLEN_P(name)+1, 1, &rv);
+ retval = zend_read_property(Z_OBJCE(disp->object), Z_OBJ(disp->object), Z_STRVAL_P(name), Z_STRLEN_P(name)+1, 1, &rv);
} else if (wFlags & DISPATCH_PROPERTYPUT) {
zend_update_property(Z_OBJCE(disp->object), &disp->object, Z_STRVAL_P(name), Z_STRLEN_P(name), &params[0]);
} else if (wFlags & DISPATCH_METHOD) {
diff --git a/ext/curl/curl_file.c b/ext/curl/curl_file.c
index 7f31451f55..950b670d84 100644
--- a/ext/curl/curl_file.c
+++ b/ext/curl/curl_file.c
@@ -71,7 +71,7 @@ static void curlfile_get_property(char *name, size_t name_len, INTERNAL_FUNCTION
zval *res, rv;
ZEND_PARSE_PARAMETERS_NONE();
- res = zend_read_property(curl_CURLFile_class, ZEND_THIS, name, name_len, 1, &rv);
+ res = zend_read_property(curl_CURLFile_class, Z_OBJ_P(ZEND_THIS), name, name_len, 1, &rv);
ZVAL_COPY_DEREF(return_value, res);
}
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index f8edbefa2f..8621c23b2b 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -2047,7 +2047,7 @@ static inline int build_mime_structure_from_hash(php_curl *ch, zval *zpostfields
curl_seek_callback seekfunc = seek_cb;
#endif
- prop = zend_read_property(curl_CURLFile_class, current, "name", sizeof("name")-1, 0, &rv);
+ prop = zend_read_property(curl_CURLFile_class, Z_OBJ_P(current), "name", sizeof("name")-1, 0, &rv);
if (Z_TYPE_P(prop) != IS_STRING) {
php_error_docref(NULL, E_WARNING, "Invalid filename for key %s", ZSTR_VAL(string_key));
} else {
@@ -2057,11 +2057,11 @@ static inline int build_mime_structure_from_hash(php_curl *ch, zval *zpostfields
return 1;
}
- prop = zend_read_property(curl_CURLFile_class, current, "mime", sizeof("mime")-1, 0, &rv);
+ prop = zend_read_property(curl_CURLFile_class, Z_OBJ_P(current), "mime", sizeof("mime")-1, 0, &rv);
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
type = Z_STRVAL_P(prop);
}
- prop = zend_read_property(curl_CURLFile_class, current, "postname", sizeof("postname")-1, 0, &rv);
+ prop = zend_read_property(curl_CURLFile_class, Z_OBJ_P(current), "postname", sizeof("postname")-1, 0, &rv);
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
filename = Z_STRVAL_P(prop);
}
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 054240acd9..8eae00fc03 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -1539,11 +1539,8 @@ static int dom_nodelist_has_dimension(zend_object *object, zval *member, int che
if (offset < 0) {
return 0;
} else {
- zval obj;
- zval *length;
-
- ZVAL_OBJ(&obj, object);
- length = zend_read_property(object->ce, &obj, "length", sizeof("length") - 1, 0, &rv);
+ zval *length = zend_read_property(
+ object->ce, object, "length", sizeof("length") - 1, 0, &rv);
return length && offset < Z_LVAL_P(length);
}
} /* }}} end dom_nodelist_has_dimension */
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index f11198f27d..4d860c2a58 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -5316,7 +5316,7 @@ ZEND_METHOD(ReflectionProperty, getValue)
RETURN_THROWS();
}
- member_p = zend_read_property_ex(intern->ce, object, ref->unmangled_name, 0, &rv);
+ member_p = zend_read_property_ex(intern->ce, Z_OBJ_P(object), ref->unmangled_name, 0, &rv);
if (member_p != &rv) {
ZVAL_COPY_DEREF(return_value, member_p);
} else {
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 4a7dc2ad80..d189b3f282 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1170,7 +1170,7 @@ static void set_zval_property(zval* object, char* name, zval* val)
static zval* get_zval_property(zval* object, char* name, zval *rv)
{
if (Z_TYPE_P(object) == IS_OBJECT) {
- zval *data = zend_read_property(Z_OBJCE_P(object), object, name, strlen(name), 1, rv);
+ zval *data = zend_read_property(Z_OBJCE_P(object), Z_OBJ_P(object), name, strlen(name), 1, rv);
if (data == &EG(uninitialized_zval)) {
return NULL;
}
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index af9b26161f..8dc05c3802 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -643,10 +643,10 @@ PHP_METHOD(SoapFault, __toString)
}
this_ptr = ZEND_THIS;
- faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, 1, &rv1);
- faultstring = zend_read_property(soap_fault_class_entry, this_ptr, "faultstring", sizeof("faultstring")-1, 1, &rv2);
- file = zend_read_property(soap_fault_class_entry, this_ptr, "file", sizeof("file")-1, 1, &rv3);
- line = zend_read_property(soap_fault_class_entry, this_ptr, "line", sizeof("line")-1, 1, &rv4);
+ faultcode = zend_read_property(soap_fault_class_entry, Z_OBJ_P(this_ptr), "faultcode", sizeof("faultcode")-1, 1, &rv1);
+ faultstring = zend_read_property(soap_fault_class_entry, Z_OBJ_P(this_ptr), "faultstring", sizeof("faultstring")-1, 1, &rv2);
+ file = zend_read_property(soap_fault_class_entry, Z_OBJ_P(this_ptr), "file", sizeof("file")-1, 1, &rv3);
+ line = zend_read_property(soap_fault_class_entry, Z_OBJ_P(this_ptr), "line", sizeof("line")-1, 1, &rv4);
zend_call_method_with_0_params(
Z_OBJ_P(ZEND_THIS), Z_OBJCE_P(ZEND_THIS), NULL, "gettraceasstring", &trace);
@@ -1176,7 +1176,7 @@ static void _soap_server_exception(soapServicePtr service, sdlFunctionPtr functi
} else if (instanceof_function(Z_OBJCE(exception_object), zend_ce_error)) {
if (service->send_errors) {
zval rv;
- zend_string *msg = zval_get_string(zend_read_property(zend_ce_error, &exception_object, "message", sizeof("message")-1, 0, &rv));
+ zend_string *msg = zval_get_string(zend_read_property(zend_ce_error, Z_OBJ(exception_object), "message", sizeof("message")-1, 0, &rv));
add_soap_fault_ex(&exception_object, this_ptr, "Server", ZSTR_VAL(msg), NULL, NULL);
zend_string_release_ex(msg, 0);
} else {
@@ -2241,7 +2241,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- msg = zval_get_string(zend_read_property(zend_ce_error, &exception_object, "message", sizeof("message")-1, 0, &rv));
+ msg = zval_get_string(zend_read_property(zend_ce_error, Z_OBJ(exception_object), "message", sizeof("message")-1, 0, &rv));
/* change class */
EG(exception)->ce = soap_fault_class_entry;
set_soap_fault(&exception_object, NULL, "Client", ZSTR_VAL(msg), NULL, NULL, NULL);
diff --git a/ext/sodium/libsodium.c b/ext/sodium/libsodium.c
index 93f1297c74..ecb11d5f38 100644
--- a/ext/sodium/libsodium.c
+++ b/ext/sodium/libsodium.c
@@ -99,7 +99,7 @@ static void sodium_remove_param_values_from_backtrace(zend_object *obj) {
zval obj_zv, rv, *trace;
ZVAL_OBJ(&obj_zv, obj);
- trace = zend_read_property(zend_get_exception_base(&obj_zv), &obj_zv, "trace", sizeof("trace")-1, 0, &rv);
+ trace = zend_read_property(zend_get_exception_base(&obj_zv), Z_OBJ(obj_zv), "trace", sizeof("trace")-1, 0, &rv);
if (trace && Z_TYPE_P(trace) == IS_ARRAY) {
zval *frame;
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(trace), frame) {
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index c71f3cb142..2410050586 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -1863,7 +1863,7 @@ PHP_METHOD(RegexIterator, accept)
break;
case REGIT_MODE_REPLACE: {
- zval *replacement = zend_read_property(intern->std.ce, ZEND_THIS, "replacement", sizeof("replacement")-1, 1, &rv);
+ zval *replacement = zend_read_property(intern->std.ce, Z_OBJ_P(ZEND_THIS), "replacement", sizeof("replacement")-1, 1, &rv);
zend_string *replacement_str = zval_try_get_string(replacement);
if (UNEXPECTED(!replacement_str)) {
return;