mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Properly release property name collection in for-in opcode handler (#2875)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
parent
fd3e982e69
commit
9a512c8fcf
@ -252,7 +252,9 @@ opfunc_for_in (ecma_value_t left_value, /**< left value */
|
||||
*result_obj_p = ecma_make_object_value (obj_p);
|
||||
}
|
||||
|
||||
jmem_heap_free_block (prop_names_coll_p, sizeof (ecma_collection_header_t));
|
||||
/* Note: We release the collection header here, and return the chunk list of the collection, which will
|
||||
* be handled and released by the vm loop. */
|
||||
jmem_pools_free (prop_names_coll_p, sizeof (ecma_collection_header_t));
|
||||
ecma_free_value (obj_expr_value);
|
||||
|
||||
return prop_names_p;
|
||||
|
||||
@ -2816,6 +2816,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
|
||||
|
||||
JERRY_ASSERT (!ecma_is_value_pointer (chunk_p->items[index]));
|
||||
|
||||
/* TODO: use collection iterator instead of directly accessing the collection chunks. */
|
||||
*stack_top_p++ = chunk_p->items[index];
|
||||
index++;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user