summaryrefslogtreecommitdiff
path: root/ext/simplexml
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2019-12-31 11:27:02 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2019-12-31 11:46:11 +0100
commit345703724c633fb8c1b34e1299bf3375f000c398 (patch)
tree18da0e12163e82ce16fbee726df1839439a1edfa /ext/simplexml
parentd9ac1ca8de298baf10f7c713c0b37c6ea5d89cf4 (diff)
downloadphp-git-345703724c633fb8c1b34e1299bf3375f000c398.tar.gz
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
Diffstat (limited to 'ext/simplexml')
-rw-r--r--ext/simplexml/simplexml.c32
-rw-r--r--ext/simplexml/sxe.c14
2 files changed, 23 insertions, 23 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 5af1b21844..f7820ddb31 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1320,7 +1320,7 @@ SXE_METHOD(xpath)
xmlNodePtr nodeptr;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &query, &query_len) == FAILURE) {
- return;
+ RETURN_THROWS();
}
sxe = Z_SXEOBJ_P(ZEND_THIS);
@@ -1405,7 +1405,7 @@ SXE_METHOD(registerXPathNamespace)
char *prefix, *ns_uri;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
- return;
+ RETURN_THROWS();
}
sxe = Z_SXEOBJ_P(ZEND_THIS);
@@ -1434,7 +1434,7 @@ SXE_METHOD(asXML)
size_t filename_len;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|p", &filename, &filename_len) == FAILURE) {
- return;
+ RETURN_THROWS();
}
sxe = Z_SXEOBJ_P(ZEND_THIS);
@@ -1556,7 +1556,7 @@ SXE_METHOD(getNamespaces)
xmlNodePtr node;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &recursive) == FAILURE) {
- return;
+ RETURN_THROWS();
}
array_init(return_value);
@@ -1605,7 +1605,7 @@ SXE_METHOD(getDocNamespaces)
xmlNodePtr node;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|bb", &recursive, &from_root) == FAILURE) {
- return;
+ RETURN_THROWS();
}
sxe = Z_SXEOBJ_P(ZEND_THIS);
@@ -1635,7 +1635,7 @@ SXE_METHOD(children)
zend_bool isprefix = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
- return;
+ RETURN_THROWS();
}
sxe = Z_SXEOBJ_P(ZEND_THIS);
@@ -1661,7 +1661,7 @@ SXE_METHOD(getName)
int namelen;
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
sxe = Z_SXEOBJ_P(ZEND_THIS);
@@ -1688,7 +1688,7 @@ SXE_METHOD(attributes)
zend_bool isprefix = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
- return;
+ RETURN_THROWS();
}
sxe = Z_SXEOBJ_P(ZEND_THIS);
@@ -1717,7 +1717,7 @@ SXE_METHOD(addChild)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!s!",
&qname, &qname_len, &value, &value_len, &nsuri, &nsuri_len) == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (qname_len == 0) {
@@ -1783,7 +1783,7 @@ SXE_METHOD(addAttribute)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|s!",
&qname, &qname_len, &value, &value_len, &nsuri, &nsuri_len) == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (qname_len == 0) {
@@ -1944,7 +1944,7 @@ static int sxe_object_cast(zend_object *readobj, zval *writeobj, int type)
SXE_METHOD(__toString)
{
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (sxe_object_cast_ex(Z_OBJ_P(ZEND_THIS), return_value, IS_STRING) != SUCCESS) {
@@ -2007,7 +2007,7 @@ SXE_METHOD(count)
php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
php_sxe_count_elements_helper(sxe, &count);
@@ -2182,7 +2182,7 @@ PHP_FUNCTION(simplexml_load_file)
zend_bool isprefix = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (ZEND_LONG_EXCEEDS_INT(options)) {
@@ -2228,7 +2228,7 @@ PHP_FUNCTION(simplexml_load_string)
zend_bool isprefix = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|C!lsb", &data, &data_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (ZEND_SIZE_T_INT_OVFL(data_len)) {
@@ -2278,7 +2278,7 @@ SXE_METHOD(__construct)
zend_bool is_url = 0, isprefix = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lbsb", &data, &data_len, &options, &is_url, &ns, &ns_len, &isprefix) == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (ZEND_SIZE_T_INT_OVFL(data_len)) {
@@ -2531,7 +2531,7 @@ PHP_FUNCTION(simplexml_import_dom)
zend_function *fptr_count;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|C!", &node, &ce) == FAILURE) {
- return;
+ RETURN_THROWS();
}
object = Z_LIBXML_NODE_P(node);
diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c
index c8fce2ccde..8c9d050dcb 100644
--- a/ext/simplexml/sxe.c
+++ b/ext/simplexml/sxe.c
@@ -39,7 +39,7 @@ PHP_SXE_API zend_class_entry *ce_SimpleXMLElement;
PHP_METHOD(ce_SimpleXMLIterator, rewind)
{
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
php_sxe_rewind_iterator(Z_SXEOBJ_P(ZEND_THIS));
@@ -53,7 +53,7 @@ PHP_METHOD(ce_SimpleXMLIterator, valid)
php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
RETURN_BOOL(!Z_ISUNDEF(sxe->iter.data));
@@ -68,7 +68,7 @@ PHP_METHOD(ce_SimpleXMLIterator, current)
zval *data;
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (Z_ISUNDEF(sxe->iter.data)) {
@@ -89,7 +89,7 @@ PHP_METHOD(ce_SimpleXMLIterator, key)
php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (Z_ISUNDEF(sxe->iter.data)) {
@@ -111,7 +111,7 @@ PHP_METHOD(ce_SimpleXMLIterator, key)
PHP_METHOD(ce_SimpleXMLIterator, next)
{
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
php_sxe_move_forward_iterator(Z_SXEOBJ_P(ZEND_THIS));
@@ -127,7 +127,7 @@ PHP_METHOD(ce_SimpleXMLIterator, hasChildren)
xmlNodePtr node;
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (Z_ISUNDEF(sxe->iter.data) || sxe->iter.type == SXE_ITER_ATTRLIST) {
@@ -154,7 +154,7 @@ PHP_METHOD(ce_SimpleXMLIterator, getChildren)
zval *data;
if (zend_parse_parameters_none() == FAILURE) {
- return;
+ RETURN_THROWS();
}
if (Z_ISUNDEF(sxe->iter.data) || sxe->iter.type == SXE_ITER_ATTRLIST) {