From: Dmitry Stogov Date: Mon, 19 Jun 2017 15:08:50 +0000 (+0300) Subject: Fixed wrong usage of old ZPP API. X-Git-Tag: php-7.2.0alpha2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40ecad34022b6e687cc654d47c88f8cef5d418fd;p=php Fixed wrong usage of old ZPP API. --- diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 21f1f71455..3684222f93 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2111,7 +2111,6 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ CURLcode error = CURLE_OK; zend_long lval; - ZVAL_DEREF(zvalue); switch (option) { /* Long options */ case CURLOPT_SSL_VERIFYHOST: @@ -2989,6 +2988,7 @@ PHP_FUNCTION(curl_setopt_array) "Array keys must be CURLOPT constants or equivalent integer values"); RETURN_FALSE; } + ZVAL_DEREF(entry); if (_php_curl_setopt(ch, (zend_long) option, entry) == FAILURE) { RETURN_FALSE; } diff --git a/ext/curl/multi.c b/ext/curl/multi.c index 322fd823f4..d45802f71d 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -339,7 +339,7 @@ PHP_FUNCTION(curl_multi_info_read) RETURN_FALSE; } if (zmsgs_in_queue) { - zval_dtor(zmsgs_in_queue); + zval_ptr_dtor(zmsgs_in_queue); ZVAL_LONG(zmsgs_in_queue, queued_msgs); } diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 4a01f31384..c203adc910 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -314,7 +314,7 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ if (ret == -1) { RETURN_VALIDATION_FAILED } else { - zval_dtor(value); + zval_ptr_dtor(value); ZVAL_BOOL(value, ret); } } diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c index a4bcc0f18a..299902fe58 100644 --- a/ext/filter/sanitizing_filters.c +++ b/ext/filter/sanitizing_filters.c @@ -213,7 +213,7 @@ void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL) Z_STRLEN_P(value) = new_len; if (new_len == 0) { - zval_dtor(value); + zval_ptr_dtor(value); if (flags & FILTER_FLAG_EMPTY_STRING_NULL) { ZVAL_NULL(value); } else { @@ -293,7 +293,7 @@ void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL) php_filter_encode_html(value, enc); } else if (flags & FILTER_FLAG_EMPTY_STRING_NULL && Z_STRLEN_P(value) == 0) { - zval_dtor(value); + zval_ptr_dtor(value); ZVAL_NULL(value); } } diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index ede61fc80a..f3201c7e46 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -62,7 +62,7 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr /* {{{ php_converter_default_callback */ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error) { ZVAL_DEREF(error); - zval_dtor(error); + zval_ptr_dtor(error); ZVAL_LONG(error, U_ZERO_ERROR); /* Basic functionality so children can call parent::toUCallback() */ switch (reason) { diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index a8331777bb..0e2290ffa1 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@ -135,7 +135,7 @@ PHP_FUNCTION(datefmt_parse) DATE_FORMAT_METHOD_INIT_VARS; /* Parse parameters. */ - if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z/!", + if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!", &object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 ); RETURN_FALSE; @@ -145,7 +145,6 @@ PHP_FUNCTION(datefmt_parse) DATE_FORMAT_METHOD_FETCH_OBJECT; if (z_parse_pos) { - ZVAL_DEREF(z_parse_pos); convert_to_long(z_parse_pos); if (ZEND_LONG_INT_OVFL(Z_LVAL_P(z_parse_pos))) { intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR); @@ -159,7 +158,7 @@ PHP_FUNCTION(datefmt_parse) } internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value); if(z_parse_pos) { - zval_dtor(z_parse_pos); + zval_ptr_dtor(z_parse_pos); ZVAL_LONG(z_parse_pos, parse_pos); } } @@ -189,7 +188,6 @@ PHP_FUNCTION(datefmt_localtime) DATE_FORMAT_METHOD_FETCH_OBJECT; if (z_parse_pos) { - ZVAL_DEREF(z_parse_pos); convert_to_long(z_parse_pos); if (ZEND_LONG_INT_OVFL(Z_LVAL_P(z_parse_pos))) { intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR); @@ -203,7 +201,7 @@ PHP_FUNCTION(datefmt_localtime) } internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value); if (z_parse_pos) { - zval_dtor(z_parse_pos); + zval_ptr_dtor(z_parse_pos); ZVAL_LONG(z_parse_pos, parse_pos); } } diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 91d5741ea1..fd03279390 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -804,8 +804,7 @@ PHP_FUNCTION(grapheme_extract) } else { ZVAL_DEREF(next); /* initialize next */ - SEPARATE_ZVAL_NOREF(next); - zval_dtor(next); + zval_ptr_dtor(next); ZVAL_LONG(next, lstart); } } diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c index cb26905305..5e1d75ddad 100644 --- a/ext/intl/spoofchecker/spoofchecker_main.c +++ b/ext/intl/spoofchecker/spoofchecker_main.c @@ -46,7 +46,7 @@ PHP_METHOD(Spoofchecker, isSuspicious) } if (error_code) { - zval_dtor(error_code); + zval_ptr_dtor(error_code); ZVAL_LONG(error_code, ret); } RETVAL_BOOL(ret != 0); @@ -81,7 +81,7 @@ PHP_METHOD(Spoofchecker, areConfusable) } if (error_code) { - zval_dtor(error_code); + zval_ptr_dtor(error_code); ZVAL_LONG(error_code, ret); } RETVAL_BOOL(ret != 0); diff --git a/ext/soap/soap.c b/ext/soap/soap.c index c874629e38..68b61304b8 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2952,6 +2952,7 @@ PHP_METHOD(SoapClient, __call) } ZEND_HASH_FOREACH_END(); } if (output_headers) { + zval_ptr_dtor(output_headers); array_init(output_headers); } do_soap_call(execute_data, this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers); diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index 37aa0d9028..8fc76436c4 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -469,6 +469,7 @@ PHP_FUNCTION(msg_send) if (result == -1) { php_error_docref(NULL, E_WARNING, "msgsnd failed: %s", strerror(errno)); if (zerror) { + zval_ptr_dtor(zerror); ZVAL_LONG(zerror, errno); } } else {