Change return value of 'ecma_ref_ecma_string' to void
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
@@ -175,7 +175,8 @@ ecma_builtin_array_prototype_object_to_locale_string (const ecma_value_t this_ar
|
||||
ecma_builtin_helper_get_to_locale_string_at_index (obj_p, 0),
|
||||
ret_value);
|
||||
|
||||
ecma_string_t *return_string_p = ecma_ref_ecma_string (ecma_get_string_from_value (first_value));
|
||||
ecma_string_t *return_string_p = ecma_get_string_from_value (first_value);
|
||||
ecma_ref_ecma_string (return_string_p);
|
||||
|
||||
/* 9-10. */
|
||||
for (uint32_t k = 1; ecma_is_value_empty (ret_value) && (k < length); k++)
|
||||
@@ -402,7 +403,8 @@ ecma_builtin_array_prototype_join (const ecma_value_t this_arg, /**< this argume
|
||||
ecma_op_array_get_to_string_at_index (obj_p, 0),
|
||||
ret_value);
|
||||
|
||||
ecma_string_t *return_string_p = ecma_ref_ecma_string (ecma_get_string_from_value (first_value));
|
||||
ecma_string_t *return_string_p = ecma_get_string_from_value (first_value);
|
||||
ecma_ref_ecma_string (return_string_p);
|
||||
|
||||
/* 9-10. */
|
||||
for (uint32_t k = 1; ecma_is_value_empty (ret_value) && (k < length); k++)
|
||||
|
||||
@@ -125,11 +125,13 @@ ecma_builtin_error_prototype_object_to_string (ecma_value_t this_arg) /**< this
|
||||
|
||||
if (ecma_string_get_length (name_string_p) == 0)
|
||||
{
|
||||
ret_str_p = ecma_ref_ecma_string (msg_string_p);
|
||||
ret_str_p = msg_string_p;
|
||||
ecma_ref_ecma_string (ret_str_p);
|
||||
}
|
||||
else if (ecma_string_get_length (msg_string_p) == 0)
|
||||
{
|
||||
ret_str_p = ecma_ref_ecma_string (name_string_p);
|
||||
ret_str_p = name_string_p;
|
||||
ecma_ref_ecma_string (ret_str_p);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -992,7 +992,8 @@ ecma_builtin_json_stringify (ecma_value_t this_arg, /**< 'this' argument */
|
||||
|
||||
if (num_of_chars < 10)
|
||||
{
|
||||
context.gap_str_p = ecma_ref_ecma_string (space_str_p);
|
||||
ecma_ref_ecma_string (space_str_p);
|
||||
context.gap_str_p = space_str_p;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1061,7 +1062,8 @@ ecma_builtin_json_quote (ecma_string_t *string_p) /**< string that should be quo
|
||||
{
|
||||
/* 1. */
|
||||
ecma_string_t *quote_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_DOUBLE_QUOTE_CHAR);
|
||||
ecma_string_t *product_str_p = ecma_ref_ecma_string (quote_str_p);
|
||||
ecma_ref_ecma_string (quote_str_p);
|
||||
ecma_string_t *product_str_p = quote_str_p;
|
||||
ecma_string_t *tmp_str_p;
|
||||
|
||||
ECMA_STRING_TO_UTF8_STRING (string_p, string_buff, string_buff_size);
|
||||
|
||||
@@ -168,7 +168,8 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this argument
|
||||
}
|
||||
else
|
||||
{
|
||||
pattern_string_p = ecma_ref_ecma_string (ecma_get_string_from_value (regexp_str_value));
|
||||
pattern_string_p = ecma_get_string_from_value (regexp_str_value);
|
||||
ecma_ref_ecma_string (pattern_string_p);
|
||||
}
|
||||
|
||||
ECMA_FINALIZE (regexp_str_value);
|
||||
@@ -380,8 +381,7 @@ ecma_builtin_regexp_prototype_to_string (ecma_value_t this_arg) /**< this argume
|
||||
|
||||
ecma_string_t *src_sep_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_SLASH_CHAR);
|
||||
ecma_string_t *source_str_p = ecma_get_string_from_value (ecma_get_named_data_property_value (source_prop_p));
|
||||
ecma_string_t *output_str_p = ecma_concat_ecma_strings (src_sep_str_p, ecma_ref_ecma_string (source_str_p));
|
||||
ecma_deref_ecma_string (source_str_p);
|
||||
ecma_string_t *output_str_p = ecma_concat_ecma_strings (src_sep_str_p, source_str_p);
|
||||
|
||||
ecma_string_t *concat_p = ecma_concat_ecma_strings (output_str_p, src_sep_str_p);
|
||||
ecma_deref_ecma_string (src_sep_str_p);
|
||||
|
||||
@@ -109,7 +109,8 @@ ecma_builtin_regexp_dispatch_construct (const ecma_value_t *arguments_list_p, /*
|
||||
}
|
||||
else
|
||||
{
|
||||
pattern_string_p = ecma_ref_ecma_string (ecma_get_string_from_value (regexp_str_value));
|
||||
pattern_string_p = ecma_get_string_from_value (regexp_str_value);
|
||||
ecma_ref_ecma_string (pattern_string_p);
|
||||
}
|
||||
|
||||
ECMA_FINALIZE (regexp_str_value);
|
||||
@@ -125,7 +126,9 @@ ecma_builtin_regexp_dispatch_construct (const ecma_value_t *arguments_list_p, /*
|
||||
ecma_op_to_string (flags_value),
|
||||
ret_value);
|
||||
|
||||
flags_string_p = ecma_ref_ecma_string (ecma_get_string_from_value (flags_str_value));
|
||||
flags_string_p = ecma_get_string_from_value (flags_str_value);
|
||||
ecma_ref_ecma_string (flags_string_p);
|
||||
|
||||
ECMA_FINALIZE (flags_str_value);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,12 +79,7 @@ ecma_builtin_string_prototype_object_to_string (ecma_value_t this_arg) /**< this
|
||||
ecma_property_t *prim_value_prop_p = ecma_get_internal_property (obj_p,
|
||||
ECMA_INTERNAL_PROPERTY_ECMA_VALUE);
|
||||
|
||||
ecma_string_t *prim_value_str_p;
|
||||
prim_value_str_p = ecma_get_string_from_value (ecma_get_internal_property_value (prim_value_prop_p));
|
||||
|
||||
prim_value_str_p = ecma_ref_ecma_string (prim_value_str_p);
|
||||
|
||||
return ecma_make_string_value (prim_value_str_p);
|
||||
return ecma_copy_value (ecma_get_internal_property_value (prim_value_prop_p));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,10 +245,11 @@ ecma_builtin_string_prototype_object_concat (ecma_value_t this_arg, /**< this ar
|
||||
ret_value);
|
||||
|
||||
/* 3 */
|
||||
// No copy performed
|
||||
/* No copy performed */
|
||||
|
||||
/* 4 */
|
||||
ecma_string_t *string_to_return = ecma_ref_ecma_string (ecma_get_string_from_value (to_string_val));
|
||||
ecma_string_t *string_to_return = ecma_get_string_from_value (to_string_val);
|
||||
ecma_ref_ecma_string (string_to_return);
|
||||
|
||||
/* 5 */
|
||||
for (uint32_t arg_index = 0;
|
||||
@@ -659,7 +655,8 @@ ecma_builtin_string_prototype_object_replace_append_substr (ecma_string_t *base_
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_string_p = ecma_ref_ecma_string (base_string_p);
|
||||
ret_string_p = base_string_p;
|
||||
ecma_ref_ecma_string (ret_string_p);
|
||||
}
|
||||
|
||||
return ret_string_p;
|
||||
|
||||
Reference in New Issue
Block a user