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:
@@ -252,7 +252,9 @@ opfunc_for_in (ecma_value_t left_value, /**< left value */
|
|||||||
*result_obj_p = ecma_make_object_value (obj_p);
|
*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);
|
ecma_free_value (obj_expr_value);
|
||||||
|
|
||||||
return prop_names_p;
|
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]));
|
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];
|
*stack_top_p++ = chunk_p->items[index];
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user