Fix value release in ecma_builtin_array_prototype_object_copy_within (#3583)

Fixes #3580

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2020-03-02 10:28:02 +01:00
committed by GitHub
parent 4e136c8973
commit a6acf2d417
2 changed files with 23 additions and 1 deletions
@@ -2441,8 +2441,11 @@ ecma_builtin_array_prototype_object_copy_within (const ecma_value_t args[], /**<
for (; count > 0; count--)
{
ecma_value_t copy_value = ecma_copy_value_if_not_object (buffer_p[start]);
ecma_free_value_if_not_object (buffer_p[target]);
buffer_p[target] = ecma_copy_value_if_not_object (buffer_p[start]);
buffer_p[target] = copy_value;
if (forward)
{