diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/com_dotnet/com_wrapper.c | 4 | ||||
-rw-r--r-- | ext/reflection/php_reflection.c | 30 | ||||
-rw-r--r-- | ext/session/mod_user.c | 2 | ||||
-rw-r--r-- | ext/soap/php_sdl.c | 3 | ||||
-rw-r--r-- | ext/soap/soap.c | 6 | ||||
-rw-r--r-- | ext/spl/spl_functions.c | 3 | ||||
-rw-r--r-- | ext/spl/spl_iterators.c | 2 | ||||
-rw-r--r-- | ext/standard/array.c | 22 | ||||
-rw-r--r-- | ext/standard/assert.c | 2 | ||||
-rw-r--r-- | ext/standard/basic_functions.c | 2 | ||||
-rw-r--r-- | ext/standard/string.c | 2 | ||||
-rw-r--r-- | ext/standard/var_unserializer.c | 2 | ||||
-rw-r--r-- | ext/standard/var_unserializer.re | 2 | ||||
-rw-r--r-- | ext/tokenizer/tokenizer.c | 2 | ||||
-rw-r--r-- | ext/xsl/xsltprocessor.c | 2 |
15 files changed, 42 insertions, 44 deletions
diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c index 409b8f9956..98252eeb24 100644 --- a/ext/com_dotnet/com_wrapper.c +++ b/ext/com_dotnet/com_wrapper.c @@ -482,7 +482,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC) } /* add the mappings */ - ZVAL_STR(&tmp2, zend_string_copy(name)); + ZVAL_STR_COPY(&tmp2, name); pid = zend_hash_next_free_element(disp->dispid_to_name); zend_hash_index_update(disp->dispid_to_name, pid, &tmp2); @@ -517,7 +517,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC) } /* add the mappings */ - ZVAL_STR(&tmp2, zend_string_copy(name)); + ZVAL_STR_COPY(&tmp2, name); pid = zend_hash_next_free_element(disp->dispid_to_name); zend_hash_index_update(disp->dispid_to_name, pid, &tmp2); diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index c2e2610308..7e4f4ab7fb 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1178,7 +1178,7 @@ PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSR reflection_object *intern; zval name; - ZVAL_STR(&name, zend_string_copy(ce->name)); + ZVAL_STR_COPY(&name, ce->name); reflection_instantiate(reflection_class_ptr, object TSRMLS_CC); intern = Z_REFLECTION_P(object); intern->ptr = ce; @@ -1251,7 +1251,7 @@ static void reflection_function_factory(zend_function *function, zval *closure_o reflection_object *intern; zval name; - ZVAL_STR(&name, zend_string_copy(function->common.function_name)); + ZVAL_STR_COPY(&name, function->common.function_name); reflection_instantiate(reflection_function_ptr, object TSRMLS_CC); intern = Z_REFLECTION_P(object); @@ -1273,9 +1273,9 @@ static void reflection_method_factory(zend_class_entry *ce, zend_function *metho zval name; zval classname; - ZVAL_STR(&name, zend_string_copy((method->common.scope && method->common.scope->trait_aliases)? - zend_resolve_method_name(ce, method) : method->common.function_name)); - ZVAL_STR(&classname, zend_string_copy(method->common.scope->name)); + ZVAL_STR_COPY(&name, (method->common.scope && method->common.scope->trait_aliases)? + zend_resolve_method_name(ce, method) : method->common.function_name); + ZVAL_STR_COPY(&classname, method->common.scope->name); reflection_instantiate(reflection_method_ptr, object TSRMLS_CC); intern = Z_REFLECTION_P(object); intern->ptr = method; @@ -1320,7 +1320,7 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info } ZVAL_STRINGL(&name, prop_name, prop_name_len); - ZVAL_STR(&classname, zend_string_copy(prop->ce->name)); + ZVAL_STR_COPY(&classname, prop->ce->name); reflection_instantiate(reflection_property_ptr, object TSRMLS_CC); intern = Z_REFLECTION_P(object); @@ -1623,7 +1623,7 @@ ZEND_METHOD(reflection_function, __construct) return; } - ZVAL_STR(&name, zend_string_copy(fptr->common.function_name)); + ZVAL_STR_COPY(&name, fptr->common.function_name); reflection_update_property(object, "name", &name); intern->ptr = fptr; intern->ref_type = REF_TYPE_FUNCTION; @@ -2740,9 +2740,9 @@ ZEND_METHOD(reflection_method, __construct) } efree(lcname); - ZVAL_STR(&name, zend_string_copy(mptr->common.scope->name)); + ZVAL_STR_COPY(&name, mptr->common.scope->name); reflection_update_property(object, "class", &name); - ZVAL_STR(&name, zend_string_copy(mptr->common.function_name)); + ZVAL_STR_COPY(&name, mptr->common.function_name); reflection_update_property(object, "name", &name); intern->ptr = mptr; intern->ref_type = REF_TYPE_FUNCTION; @@ -3305,7 +3305,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob } if (Z_TYPE_P(argument) == IS_OBJECT) { - ZVAL_STR(&classname, zend_string_copy(Z_OBJCE_P(argument)->name)); + ZVAL_STR_COPY(&classname, Z_OBJCE_P(argument)->name); reflection_update_property(object, "name", &classname); intern->ptr = Z_OBJCE_P(argument); if (is_object) { @@ -3321,7 +3321,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob return; } - ZVAL_STR(&classname, zend_string_copy(ce->name)); + ZVAL_STR_COPY(&classname, ce->name); reflection_update_property(object, "name", &classname); intern->ptr = ce; @@ -3795,7 +3795,7 @@ ZEND_METHOD(reflection_class, hasProperty) RETURN_TRUE; } else { if (Z_TYPE(intern->obj) != IS_UNDEF && Z_OBJ_HANDLER(intern->obj, has_property)) { - ZVAL_STR(&property, zend_string_copy(name)); + ZVAL_STR_COPY(&property, name); if (Z_OBJ_HANDLER(intern->obj, has_property)(&intern->obj, &property, 2, NULL TSRMLS_CC)) { zval_ptr_dtor(&property); RETURN_TRUE; @@ -4799,10 +4799,10 @@ ZEND_METHOD(reflection_property, __construct) const char *class_name, *prop_name; size_t prop_name_len; zend_unmangle_property_name_ex(property_info->name, &class_name, &prop_name, &prop_name_len); - ZVAL_STR(&cname, zend_string_copy(property_info->ce->name)); + ZVAL_STR_COPY(&cname, property_info->ce->name); ZVAL_STRINGL(&propname, prop_name, prop_name_len); } else { - ZVAL_STR(&cname, zend_string_copy(ce->name)); + ZVAL_STR_COPY(&cname, ce->name); ZVAL_STRINGL(&propname, name_str, name_len); } reflection_update_property(object, "class", &cname); @@ -5284,7 +5284,7 @@ static int _addinientry(zval *el TSRMLS_DC, int num_args, va_list args, zend_has if (ini_entry->value) { zval zv; - ZVAL_STR(&zv, zend_string_copy(ini_entry->value)); + ZVAL_STR_COPY(&zv, ini_entry->value); zend_symtable_update(Z_ARRVAL_P(retval), ini_entry->name, &zv); } else { zend_symtable_update(Z_ARRVAL_P(retval), ini_entry->name, &EG(uninitialized_zval)); diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index 5d69712543..f42ae15cbf 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -44,7 +44,7 @@ ps_module ps_mod_user = { #define SESS_ZVAL_STR(vl, a) \ { \ - ZVAL_STR(a, zend_string_copy(vl)); \ + ZVAL_STR_COPY(a, vl); \ } static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval TSRMLS_DC) diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index c7e52dfb8c..d67bea1ab7 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -3288,9 +3288,8 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC) } smart_str_0(&headers); - ZVAL_STR(&str_headers, zend_string_copy(headers.s)); + ZVAL_NEW_STR(&str_headers, headers.s); php_stream_context_set_option(context, "http", "header", &str_headers); - smart_str_free(&headers); zval_ptr_dtor(&str_headers); } diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 554957d512..97a569de30 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1429,7 +1429,7 @@ PHP_METHOD(SoapServer, addFunction) return; } - ZVAL_STR(&function_copy, zend_string_copy(f->common.function_name)); + ZVAL_STR_COPY(&function_copy, f->common.function_name); zend_hash_update(service->soap_functions.ft, key, &function_copy); zend_string_release(key); @@ -1452,7 +1452,7 @@ PHP_METHOD(SoapServer, addFunction) zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0); } - ZVAL_STR(&function_copy, zend_string_copy(f->common.function_name)); + ZVAL_STR_COPY(&function_copy, f->common.function_name); zend_hash_update(service->soap_functions.ft, key, &function_copy); zend_string_release(key); } else if (Z_TYPE_P(function_name) == IS_LONG) { @@ -1713,7 +1713,7 @@ PHP_METHOD(SoapServer, handle) if (zend_hash_str_exists(&Z_OBJCE(tmp_soap)->function_table, php_strtolower(class_name, class_name_len), class_name_len)) { zval c_ret, constructor; - ZVAL_STR(&constructor, zend_string_copy(service->soap_class.ce->name)); + ZVAL_STR_COPY(&constructor, service->soap_class.ce->name); if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor"); } diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c index 13440355ce..4c0d29aa46 100644 --- a/ext/spl/spl_functions.c +++ b/ext/spl/spl_functions.c @@ -84,8 +84,7 @@ void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_fla if ((tmp = zend_hash_find(Z_ARRVAL_P(list), pce->name)) == NULL) { zval t; - zend_string_addref(pce->name); - ZVAL_STR(&t, pce->name); + ZVAL_STR_COPY(&t, pce->name); zend_hash_add(Z_ARRVAL_P(list), pce->name, &t); } } diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index dcc2a8a573..39e5bd512f 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -2264,7 +2264,7 @@ SPL_METHOD(RecursiveRegexIterator, getChildren) zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval); if (!EG(exception)) { - ZVAL_STR(®ex, zend_string_copy(intern->u.regex.regex)); + ZVAL_STR_COPY(®ex, intern->u.regex.regex); spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &retval, ®ex TSRMLS_CC); zval_ptr_dtor(®ex); } diff --git a/ext/standard/array.c b/ext/standard/array.c index ecb8603d2c..b6ca16ca7f 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -706,12 +706,12 @@ static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /* if (f->key == NULL) { ZVAL_LONG(&args[0], f->h); } else { - ZVAL_STR(&args[0], zend_string_copy(f->key)); + ZVAL_STR_COPY(&args[0], f->key); } if (s->key == NULL) { ZVAL_LONG(&args[1], s->h); } else { - ZVAL_STR(&args[1], zend_string_copy(s->key)); + ZVAL_STR_COPY(&args[1], s->key); } BG(user_compare_fci).param_count = 2; @@ -1427,7 +1427,7 @@ PHP_FUNCTION(extract) if (var_exists && var_name->len == sizeof("this")-1 && !strcmp(var_name->val, "this") && EG(scope) && EG(scope)->name->len != 0) { break; } - ZVAL_STR(&final_name, zend_string_copy(var_name)); + ZVAL_STR_COPY(&final_name, var_name); break; case EXTR_PREFIX_IF_EXISTS: @@ -1438,7 +1438,7 @@ PHP_FUNCTION(extract) case EXTR_PREFIX_SAME: if (!var_exists && var_name->len != 0) { - ZVAL_STR(&final_name, zend_string_copy(var_name)); + ZVAL_STR_COPY(&final_name, var_name); } /* break omitted intentionally */ @@ -1453,14 +1453,14 @@ PHP_FUNCTION(extract) if (!php_valid_var_name(var_name->val, var_name->len)) { php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC); } else { - ZVAL_STR(&final_name, zend_string_copy(var_name)); + ZVAL_STR_COPY(&final_name, var_name); } } break; default: if (!var_exists) { - ZVAL_STR(&final_name, zend_string_copy(var_name)); + ZVAL_STR_COPY(&final_name, var_name); } break; } @@ -2605,7 +2605,7 @@ PHP_FUNCTION(array_keys) if (add_key) { if (str_idx) { - ZVAL_STR(&new_val, zend_string_copy(str_idx)); + ZVAL_STR_COPY(&new_val, str_idx); } else { ZVAL_LONG(&new_val, num_idx); } @@ -2889,14 +2889,14 @@ PHP_FUNCTION(array_flip) ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) { if (Z_TYPE_P(entry) == IS_LONG) { if (str_idx) { - ZVAL_STR(&data, zend_string_copy(str_idx)); + ZVAL_STR_COPY(&data, str_idx); } else { ZVAL_LONG(&data, num_idx); } zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_P(entry), &data); } else if (Z_TYPE_P(entry) == IS_STRING) { if (str_idx) { - ZVAL_STR(&data, zend_string_copy(str_idx)); + ZVAL_STR_COPY(&data, str_idx); } else { ZVAL_LONG(&data, num_idx); } @@ -4366,9 +4366,9 @@ PHP_FUNCTION(array_filter) } } else { if (use_type == ARRAY_FILTER_USE_BOTH) { - ZVAL_STR(&args[1], zend_string_copy(string_key)); + ZVAL_STR_COPY(&args[1], string_key); } else if (use_type == ARRAY_FILTER_USE_KEY) { - ZVAL_STR(&args[0], zend_string_copy(string_key)); + ZVAL_STR_COPY(&args[0], string_key); } } } diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 94fee5a1ce..1537022538 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -59,7 +59,7 @@ static PHP_INI_MH(OnChangeCallback) /* {{{ */ ZVAL_UNDEF(&ASSERTG(callback)); } if (new_value && (Z_TYPE(ASSERTG(callback)) != IS_UNDEF || new_value->len)) { - ZVAL_STR(&ASSERTG(callback), zend_string_copy(new_value)); + ZVAL_STR_COPY(&ASSERTG(callback), new_value); } } else { if (ASSERTG(cb)) { diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 53aec268b0..f6ad7dbdd7 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5261,7 +5261,7 @@ static int php_ini_get_option(zval *zv TSRMLS_DC, int num_args, va_list args, ze if (ini_entry->value) { zval zv; - ZVAL_STR(&zv, zend_string_copy(ini_entry->value)); + ZVAL_STR_COPY(&zv, ini_entry->value); zend_symtable_update(Z_ARRVAL_P(ini_array), ini_entry->name, &zv); } else { zend_symtable_update(Z_ARRVAL_P(ini_array), ini_entry->name, &EG(uninitialized_zval)); diff --git a/ext/standard/string.c b/ext/standard/string.c index fec8b70934..a5041afee3 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2559,7 +2559,7 @@ PHP_FUNCTION(substr_replace) if (str_index) { zval tmp; - ZVAL_STR(&tmp, result); + ZVAL_NEW_STR(&tmp, result); zend_symtable_update(Z_ARRVAL_P(return_value), str_index, &tmp); } else { add_index_str(return_value, num_index, result); diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 7e6789daaa..20d6260228 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -700,7 +700,7 @@ yy20: /* Call unserialize callback */ ZVAL_STRING(&user_func, PG(unserialize_callback_func)); - ZVAL_STR(&args[0], zend_string_copy(class_name)); + ZVAL_STR_COPY(&args[0], class_name); BG(serialize_lock)++; if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { BG(serialize_lock)--; diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 39161353f8..7924022263 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -755,7 +755,7 @@ object ":" uiv ":" ["] { /* Call unserialize callback */ ZVAL_STRING(&user_func, PG(unserialize_callback_func)); - ZVAL_STR(&args[0], zend_string_copy(class_name)); + ZVAL_STR_COPY(&args[0], class_name); BG(serialize_lock)++; if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { BG(serialize_lock)--; diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index 1847b0537d..80ab5a81d8 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -185,7 +185,7 @@ PHP_FUNCTION(token_get_all) return; } - ZVAL_STR(&source_zval, zend_string_copy(source)); + ZVAL_STR_COPY(&source_zval, source); zend_save_lexical_state(&original_lex_state TSRMLS_CC); if (zend_prepare_string_for_scanning(&source_zval, "" TSRMLS_CC) == FAILURE) { diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index cd828c75a0..6c53f39a6d 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -791,7 +791,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter) intern = Z_XSL_P(id); - ZVAL_STR(&new_string, zend_string_copy(value)); + ZVAL_STR_COPY(&new_string, value); zend_hash_update(intern->parameter, name, &new_string); RETURN_TRUE; |