ecma_ref_ecma_string -> ecma_copy_or_ref_ecma_string: copying ecma-string when the string's reference counter reaches maximum value.

This commit is contained in:
Ruben Ayrapetyan
2014-10-13 18:59:07 +04:00
parent 9a15286aad
commit 6430a104b3
8 changed files with 42 additions and 17 deletions
+6 -2
View File
@@ -212,9 +212,13 @@ ecma_copy_value (const ecma_value_t value, /**< ecma-value */
ecma_string_t *string_p = ECMA_GET_POINTER(value.value);
JERRY_ASSERT(string_p != NULL);
ecma_ref_ecma_string (string_p);
string_p = ecma_copy_or_ref_ecma_string (string_p);
value_copy = value;
value_copy = (ecma_value_t)
{
.value_type = ECMA_TYPE_STRING
};
ECMA_SET_NON_NULL_POINTER(value_copy.value, string_p);
break;
}