From 2f7309b1e9d36fa6e061394f84c73c30a29a88a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 30 Dec 2019 18:14:29 +0100 Subject: Use RETURN_THROWS() during ZPP in the date, dba and dom extensions --- ext/date/php_date.c | 16 ++++++------ ext/dba/dba.c | 24 +++++++++--------- ext/dom/attr.c | 4 +-- ext/dom/cdatasection.c | 2 +- ext/dom/characterdata.c | 10 ++++---- ext/dom/comment.c | 2 +- ext/dom/document.c | 56 ++++++++++++++++++++--------------------- ext/dom/documentfragment.c | 6 ++--- ext/dom/domimplementation.c | 8 +++--- ext/dom/element.c | 38 ++++++++++++++-------------- ext/dom/entityreference.c | 2 +- ext/dom/namednodemap.c | 8 +++--- ext/dom/node.c | 34 ++++++++++++------------- ext/dom/nodelist.c | 4 +-- ext/dom/php_dom.c | 2 +- ext/dom/php_dom.h | 2 +- ext/dom/processinginstruction.c | 2 +- ext/dom/text.c | 6 ++--- ext/dom/xpath.c | 6 ++--- 19 files changed, 116 insertions(+), 116 deletions(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 7dcc212e21..1c3c11fc35 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2946,7 +2946,7 @@ PHP_METHOD(DateTimeImmutable, modify) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &modify, &modify_len) == FAILURE) { - RETURN_FALSE; + RETURN_THROWS(); } date_clone_immutable(object, &new_object); @@ -3000,7 +3000,7 @@ PHP_METHOD(DateTimeImmutable, add) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &interval, date_ce_interval) == FAILURE) { - RETURN_FALSE; + RETURN_THROWS(); } date_clone_immutable(object, &new_object); @@ -3057,7 +3057,7 @@ PHP_METHOD(DateTimeImmutable, sub) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &interval, date_ce_interval) == FAILURE) { - RETURN_FALSE; + RETURN_THROWS(); } date_clone_immutable(object, &new_object); @@ -3162,7 +3162,7 @@ PHP_METHOD(DateTimeImmutable, setTimezone) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &timezone_object, date_ce_timezone) == FAILURE) { - RETURN_FALSE; + RETURN_THROWS(); } date_clone_immutable(object, &new_object); @@ -3248,7 +3248,7 @@ PHP_METHOD(DateTimeImmutable, setTime) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll|ll", &h, &i, &s, &ms) == FAILURE) { - RETURN_FALSE; + RETURN_THROWS(); } date_clone_immutable(object, &new_object); @@ -3298,7 +3298,7 @@ PHP_METHOD(DateTimeImmutable, setDate) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &y, &m, &d) == FAILURE) { - RETURN_FALSE; + RETURN_THROWS(); } date_clone_immutable(object, &new_object); @@ -3352,7 +3352,7 @@ PHP_METHOD(DateTimeImmutable, setISODate) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll|l", &y, &w, &d) == FAILURE) { - RETURN_FALSE; + RETURN_THROWS(); } date_clone_immutable(object, &new_object); @@ -3401,7 +3401,7 @@ PHP_METHOD(DateTimeImmutable, setTimestamp) object = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", ×tamp) == FAILURE) { - RETURN_FALSE; + RETURN_THROWS(); } date_clone_immutable(object, &new_object); diff --git a/ext/dba/dba.c b/ext/dba/dba.c index ad7ba2e793..06fc1829cd 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -168,7 +168,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free) char *key_str, *key_free; \ size_t key_len; \ if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) { \ - return; \ + RETURN_THROWS(); \ } \ if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {\ RETURN_FALSE; \ @@ -182,12 +182,12 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free) switch(ac) { \ case 2: \ if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) { \ - return; \ + RETURN_THROWS(); \ } \ break; \ case 3: \ if (zend_parse_parameters(ac, "zlr", &key, &skip, &id) == FAILURE) { \ - return; \ + RETURN_THROWS(); \ } \ break; \ default: \ @@ -507,7 +507,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) size_t key_len; if (zend_parse_parameters(ac, "zsr", &key, &val, &val_len, &id) == FAILURE) { - return; + RETURN_THROWS(); } if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) { @@ -964,7 +964,7 @@ PHP_FUNCTION(dba_close) dba_info *info = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) { - return; + RETURN_THROWS(); } DBA_FETCH_RESOURCE(info, id); @@ -1048,7 +1048,7 @@ PHP_FUNCTION(dba_key_split) } } if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &key, &key_len) == FAILURE) { - return; + RETURN_THROWS(); } array_init(return_value); if (key[0] == '[' && (name = strchr(key, ']')) != NULL) { @@ -1071,7 +1071,7 @@ PHP_FUNCTION(dba_firstkey) dba_info *info = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) { - return; + RETURN_THROWS(); } DBA_FETCH_RESOURCE(info, id); @@ -1098,7 +1098,7 @@ PHP_FUNCTION(dba_nextkey) dba_info *info = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) { - return; + RETURN_THROWS(); } DBA_FETCH_RESOURCE(info, id); @@ -1160,7 +1160,7 @@ PHP_FUNCTION(dba_optimize) dba_info *info = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) { - return; + RETURN_THROWS(); } DBA_FETCH_RESOURCE(info, id); @@ -1183,7 +1183,7 @@ PHP_FUNCTION(dba_sync) dba_info *info = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) { - return; + RETURN_THROWS(); } DBA_FETCH_RESOURCE(info, id); @@ -1204,7 +1204,7 @@ PHP_FUNCTION(dba_handlers) zend_bool full_info = 0; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_info) == FAILURE) { - return; + RETURN_THROWS(); } array_init(return_value); @@ -1231,7 +1231,7 @@ PHP_FUNCTION(dba_list) dba_info *info; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } array_init(return_value); diff --git a/ext/dom/attr.c b/ext/dom/attr.c index 2b01be4b1e..1f24869f0d 100644 --- a/ext/dom/attr.c +++ b/ext/dom/attr.c @@ -49,7 +49,7 @@ PHP_METHOD(domattr, __construct) size_t name_len, value_len, name_valid; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &name, &name_len, &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(ZEND_THIS); @@ -221,7 +221,7 @@ PHP_METHOD(domattr, isId) id = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(attrp, id, xmlAttrPtr, intern); diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c index 55fae82d2e..ee660feda0 100644 --- a/ext/dom/cdatasection.c +++ b/ext/dom/cdatasection.c @@ -45,7 +45,7 @@ PHP_METHOD(domcdatasection, __construct) size_t value_len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } nodep = xmlNewCDataBlock(NULL, (xmlChar *) value, value_len); diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c index f4a7b4756b..b3e91e769c 100644 --- a/ext/dom/characterdata.c +++ b/ext/dom/characterdata.c @@ -134,7 +134,7 @@ PHP_METHOD(domcharacterdata, substringData) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &offset, &count) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(node, id, xmlNodePtr, intern); @@ -182,7 +182,7 @@ PHP_METHOD(domcharacterdata, appendData) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -208,7 +208,7 @@ PHP_METHOD(domcharacterdata, insertData) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &offset, &arg, &arg_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(node, id, xmlNodePtr, intern); @@ -256,7 +256,7 @@ PHP_METHOD(domcharacterdata, deleteData) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &offset, &count) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(node, id, xmlNodePtr, intern); @@ -314,7 +314,7 @@ PHP_METHOD(domcharacterdata, replaceData) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "lls", &offset, &count, &arg, &arg_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(node, id, xmlNodePtr, intern); diff --git a/ext/dom/comment.c b/ext/dom/comment.c index c3019d6938..370b8c4a9f 100644 --- a/ext/dom/comment.c +++ b/ext/dom/comment.c @@ -45,7 +45,7 @@ PHP_METHOD(domcomment, __construct) size_t value_len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } nodep = xmlNewComment((xmlChar *) value); diff --git a/ext/dom/document.c b/ext/dom/document.c index 1b1d1a4dc4..07eaec58f8 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -563,7 +563,7 @@ PHP_METHOD(domdocument, createElement) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &name, &name_len, &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -596,7 +596,7 @@ PHP_METHOD(domdocument, createDocumentFragment) id = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -626,7 +626,7 @@ PHP_METHOD(domdocument, createTextNode) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -656,7 +656,7 @@ PHP_METHOD(domdocument, createComment) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -686,7 +686,7 @@ PHP_METHOD(domdocument, createCDATASection) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -716,7 +716,7 @@ PHP_METHOD(domdocument, createProcessingInstruction) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &name, &name_len, &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -753,7 +753,7 @@ PHP_METHOD(domdocument, createAttribute) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -789,7 +789,7 @@ PHP_METHOD(domdocument, createEntityReference) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -823,7 +823,7 @@ PHP_METHOD(domdocument, getElementsByTagName) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -850,7 +850,7 @@ PHP_METHOD(domdocument, importNode) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &node, dom_node_class_entry, &recursive) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -910,7 +910,7 @@ PHP_METHOD(domdocument, createElementNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s|s", &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -975,7 +975,7 @@ PHP_METHOD(domdocument, createAttributeNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1038,7 +1038,7 @@ PHP_METHOD(domdocument, getElementsByTagNameNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &uri, &uri_len, &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1067,7 +1067,7 @@ PHP_METHOD(domdocument, getElementById) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &idname, &idname_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1092,7 +1092,7 @@ PHP_METHOD(domdocument, adoptNode) zval *nodep = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &nodep, dom_node_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } DOM_NOT_IMPLEMENTED(); @@ -1111,7 +1111,7 @@ PHP_METHOD(domdocument, normalizeDocument) id = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1130,7 +1130,7 @@ PHP_METHOD(domdocument, __construct) int refcount; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ss", &version, &version_len, &encoding, &encoding_len) == FAILURE) { - return; + RETURN_THROWS(); } docp = xmlNewDoc((xmlChar *) version); @@ -1354,7 +1354,7 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) { } if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &options) == FAILURE) { - return; + RETURN_THROWS(); } if (!source_len) { @@ -1441,7 +1441,7 @@ PHP_METHOD(domdocument, save) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &file, &file_len, &options) == FAILURE) { - return; + RETURN_THROWS(); } if (file_len == 0) { @@ -1488,7 +1488,7 @@ PHP_METHOD(domdocument, saveXML) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|O!l", &nodep, dom_node_class_entry, &options) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1596,7 +1596,7 @@ PHP_METHOD(domdocument, xinclude) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flags) == FAILURE) { - return; + RETURN_THROWS(); } if (ZEND_LONG_EXCEEDS_INT(flags)) { @@ -1641,7 +1641,7 @@ PHP_METHOD(domdocument, validate) id = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1681,7 +1681,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &flags) == FAILURE) { - return; + RETURN_THROWS(); } if (source_len == 0) { @@ -1780,7 +1780,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &source, &source_len) == FAILURE) { - return; + RETURN_THROWS(); } if (source_len == 0) { @@ -1878,7 +1878,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ id = getThis(); if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &options) == FAILURE) { - return; + RETURN_THROWS(); } if (!source_len) { @@ -1991,7 +1991,7 @@ PHP_METHOD(domdocument, saveHTMLFile) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &file, &file_len) == FAILURE) { - return; + RETURN_THROWS(); } if (file_len == 0) { @@ -2034,7 +2034,7 @@ PHP_METHOD(domdocument, saveHTML) if (zend_parse_parameters(ZEND_NUM_ARGS(), "|O!", &nodep, dom_node_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -2115,7 +2115,7 @@ PHP_METHOD(domdocument, registerNodeClass) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "CC!", &basece, &ce) == FAILURE) { - return; + RETURN_THROWS(); } if (ce == NULL || instanceof_function(ce, basece)) { diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index f92025589c..d0f44a7d8f 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -43,8 +43,8 @@ PHP_METHOD(domdocumentfragment, __construct) xmlNodePtr nodep = NULL, oldnode = NULL; dom_object *intern; - if (zend_parse_parameters_none_throw() == FAILURE) { - return; + if (zend_parse_parameters_none() == FAILURE) { + RETURN_THROWS(); } nodep = xmlNewDocFragment(NULL); @@ -110,7 +110,7 @@ PHP_METHOD(domdocumentfragment, appendXML) { id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &data, &data_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index 094fcd4373..97d1f98b92 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -49,7 +49,7 @@ PHP_METHOD(domimplementation, hasFeature) char *feature, *version; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &feature, &feature_len, &version, &version_len) == FAILURE) { - return; + RETURN_THROWS(); } if (dom_has_feature(feature, version)) { @@ -74,7 +74,7 @@ PHP_METHOD(domimplementation, createDocumentType) xmlURIPtr uri; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ss", &name, &name_len, &publicid, &publicid_len, &systemid, &systemid_len) == FAILURE) { - return; + RETURN_THROWS(); } if (name_len == 0) { @@ -140,7 +140,7 @@ PHP_METHOD(domimplementation, createDocument) dom_object *doctobj; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ssO!", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } if (node != NULL) { @@ -237,7 +237,7 @@ PHP_METHOD(domimplementation, getFeature) char *feature, *version; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &feature, &feature_len, &version, &version_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_NOT_IMPLEMENTED(); diff --git a/ext/dom/element.c b/ext/dom/element.c index c9844eda96..a84ae0bd93 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -68,7 +68,7 @@ PHP_METHOD(domelement, __construct) xmlNsPtr nsptr = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!s", &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) { - return; + RETURN_THROWS(); } name_valid = xmlValidateName((xmlChar *) name, 0); @@ -234,7 +234,7 @@ PHP_METHOD(domelement, getAttribute) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -278,7 +278,7 @@ PHP_METHOD(domelement, setAttribute) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } if (name_len == 0) { @@ -344,7 +344,7 @@ PHP_METHOD(domelement, removeAttribute) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -394,7 +394,7 @@ PHP_METHOD(domelement, getAttributeNode) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -441,7 +441,7 @@ PHP_METHOD(domelement, setAttributeNode) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_attr_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -508,7 +508,7 @@ PHP_METHOD(domelement, removeAttributeNode) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_attr_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -547,7 +547,7 @@ PHP_METHOD(domelement, getElementsByTagName) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); @@ -575,7 +575,7 @@ PHP_METHOD(domelement, getAttributeNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); @@ -658,7 +658,7 @@ PHP_METHOD(domelement, setAttributeNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!ss", &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } if (name_len == 0) { @@ -785,7 +785,7 @@ PHP_METHOD(domelement, removeAttributeNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -843,7 +843,7 @@ PHP_METHOD(domelement, getAttributeNodeNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); @@ -898,7 +898,7 @@ PHP_METHOD(domelement, setAttributeNodeNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_attr_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -972,7 +972,7 @@ PHP_METHOD(domelement, getElementsByTagNameNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &uri, &uri_len, &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); @@ -1001,7 +1001,7 @@ PHP_METHOD(domelement, hasAttribute) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1031,7 +1031,7 @@ PHP_METHOD(domelement, hasAttributeNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); @@ -1089,7 +1089,7 @@ PHP_METHOD(domelement, setIdAttribute) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "sb", &name, &name_len, &is_id) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1126,7 +1126,7 @@ PHP_METHOD(domelement, setIdAttributeNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssb", &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(elemp, id, xmlNodePtr, intern); @@ -1161,7 +1161,7 @@ PHP_METHOD(domelement, setIdAttributeNode) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &node, dom_attr_class_entry, &is_id) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c index a8d73f42f7..ac5258ff2f 100644 --- a/ext/dom/entityreference.c +++ b/ext/dom/entityreference.c @@ -46,7 +46,7 @@ PHP_METHOD(domentityreference, __construct) size_t name_len, name_valid; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { - return; + RETURN_THROWS(); } name_valid = xmlValidateName((xmlChar *) name, 0); diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c index df731e2381..33048fd09b 100644 --- a/ext/dom/namednodemap.c +++ b/ext/dom/namednodemap.c @@ -100,7 +100,7 @@ PHP_METHOD(domnamednodemap, getNamedItem) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &named, &namedlen) == FAILURE) { - return; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(id); @@ -155,7 +155,7 @@ PHP_METHOD(domnamednodemap, item) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) { - return; + RETURN_THROWS(); } if (index >= 0) { if (ZEND_LONG_INT_OVFL(index)) { @@ -220,7 +220,7 @@ PHP_METHOD(domnamednodemap, getNamedItemNS) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &urilen, &named, &namedlen) == FAILURE) { - return; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(id); @@ -266,7 +266,7 @@ PHP_METHOD(domnamednodemap, count) id = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(id); diff --git a/ext/dom/node.c b/ext/dom/node.c index 459fb9b444..4caf85c36f 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -838,7 +838,7 @@ PHP_METHOD(domnode, insertBefore) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|O!", &node, dom_node_class_entry, &ref, dom_node_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(parentp, id, xmlNodePtr, intern); @@ -1002,7 +1002,7 @@ PHP_METHOD(domnode, replaceChild) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &newnode, dom_node_class_entry, &oldnode, dom_node_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1089,7 +1089,7 @@ PHP_METHOD(domnode, removeChild) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_node_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1141,7 +1141,7 @@ PHP_METHOD(domnode, appendChild) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_node_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1242,7 +1242,7 @@ PHP_METHOD(domnode, hasChildNodes) id = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1273,7 +1273,7 @@ PHP_METHOD(domnode, cloneNode) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &recursive) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(n, id, xmlNodePtr, intern); @@ -1333,7 +1333,7 @@ PHP_METHOD(domnode, normalize) id = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1353,7 +1353,7 @@ PHP_METHOD(domnode, isSupported) char *feature, *version; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &feature, &feature_len, &version, &version_len) == FAILURE) { - return; + RETURN_THROWS(); } if (dom_has_feature(feature, version)) { @@ -1376,7 +1376,7 @@ PHP_METHOD(domnode, hasAttributes) id = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1404,7 +1404,7 @@ PHP_METHOD(domnode, isSameNode) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_node_class_entry) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1434,7 +1434,7 @@ PHP_METHOD(domnode, lookupPrefix) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &uri, &uri_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1486,7 +1486,7 @@ PHP_METHOD(domnode, isDefaultNamespace) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &uri, &uri_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1520,7 +1520,7 @@ PHP_METHOD(domnode, lookupNamespaceURI) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!", &prefix, &prefix_len) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(nodep, id, xmlNodePtr, intern); @@ -1562,13 +1562,13 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|bba!a!", &exclusive, &with_comments, &xpath_array, &ns_prefixes) == FAILURE) { - return; + RETURN_THROWS(); } } else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bba!a!", &file, &file_len, &exclusive, &with_comments, &xpath_array, &ns_prefixes) == FAILURE) { - return; + RETURN_THROWS(); } } @@ -1741,7 +1741,7 @@ PHP_METHOD(domnode, getNodePath) char *value; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern); @@ -1765,7 +1765,7 @@ PHP_METHOD(domnode, getLineNo) dom_object *intern; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern); diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c index 8d65eb8047..21addd2d18 100644 --- a/ext/dom/nodelist.c +++ b/ext/dom/nodelist.c @@ -98,7 +98,7 @@ PHP_METHOD(domnodelist, count) id = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } intern = Z_DOMOBJ_P(id); @@ -128,7 +128,7 @@ PHP_METHOD(domnodelist, item) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) { - return; + RETURN_THROWS(); } if (index >= 0) { diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index b3a6b45ba9..4098a554de 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -455,7 +455,7 @@ PHP_FUNCTION(dom_import_simplexml) int ret; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &node) == FAILURE) { - return; + RETURN_THROWS(); } nodeobj = (php_libxml_node_object *) ((char *) Z_OBJ_P(node) - Z_OBJ_HT_P(node)->offset); diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 11ca442df2..da4d2ad01b 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -140,7 +140,7 @@ entry = zend_register_internal_class_ex(&ce, parent_ce); #define DOM_NO_ARGS() \ if (zend_parse_parameters_none() == FAILURE) { \ - return; \ + RETURN_THROWS(); \ } #define DOM_NOT_IMPLEMENTED() \ diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c index efdfd5ea61..8e250f1301 100644 --- a/ext/dom/processinginstruction.c +++ b/ext/dom/processinginstruction.c @@ -46,7 +46,7 @@ PHP_METHOD(domprocessinginstruction, __construct) int name_valid; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &name, &name_len, &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } name_valid = xmlValidateName((xmlChar *) name, 0); diff --git a/ext/dom/text.c b/ext/dom/text.c index 3d983c4fdd..a20097a36e 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -49,7 +49,7 @@ PHP_METHOD(domtext, __construct) size_t value_len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &value, &value_len) == FAILURE) { - return; + RETURN_THROWS(); } nodep = xmlNewText((xmlChar *) value); @@ -128,7 +128,7 @@ PHP_METHOD(domtext, splitText) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &offset) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(node, id, xmlNodePtr, intern); @@ -184,7 +184,7 @@ PHP_METHOD(domtext, isWhitespaceInElementContent) id = ZEND_THIS; if (zend_parse_parameters_none() == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(node, id, xmlNodePtr, intern); diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index b78f67546f..63b0326596 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -231,7 +231,7 @@ PHP_METHOD(domxpath, __construct) xmlXPathContextPtr ctx, oldctx; if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &doc, dom_document_class_entry, ®ister_node_ns) == FAILURE) { - return; + RETURN_THROWS(); } DOM_GET_OBJ(docp, doc, xmlDocPtr, docobj); @@ -312,7 +312,7 @@ PHP_METHOD(domxpath, registerNamespace) id = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) { - return; + RETURN_THROWS(); } intern = Z_XPATHOBJ_P(id); @@ -358,7 +358,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */ register_node_ns = intern->register_node_ns; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|O!b", &expr, &expr_len, &context, dom_node_class_entry, ®ister_node_ns) == FAILURE) { - return; + RETURN_THROWS(); } ctxp = (xmlXPathContextPtr) intern->dom.ptr; -- cgit v1.2.1