Correct release of spread arguments (#3867)

During the `opfunc_spread_arguments` argument release process
the stack pointer was incremented early resulting in a state where
one of the arguments was not freed causing a memory leak.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
Péter Gál
2020-06-06 18:39:40 +02:00
committed by GitHub
parent cae6cd08fb
commit ba4e3a402f
2 changed files with 54 additions and 1 deletions
+1 -1
View File
@@ -471,7 +471,7 @@ opfunc_spread_arguments (ecma_value_t *stack_top_p, /**< pointer to the current
{
for (uint32_t k = i + 1; k < arguments_list_len; k++)
{
ecma_free_value (*(++stack_top_p));
ecma_free_value (*stack_top_p++);
}
ecma_collection_free (buff_p);