Replacing dynamically sized on-stack arrays with heap allocated arrays defined through MEM_DEFINE_LOCAL_ARRAY.

This commit is contained in:
Ruben Ayrapetyan
2014-12-18 13:27:15 +03:00
parent 1e0eea3d73
commit 84294018a3
7 changed files with 70 additions and 32 deletions
@@ -130,7 +130,7 @@ ecma_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function */
ecma_object_t *map_p = ecma_op_create_object_object_noarg ();
// 11.c
ecma_string_t *formal_params[formal_params_number];
MEM_DEFINE_LOCAL_ARRAY (formal_params, formal_params_number, ecma_string_t *);
JERRY_ASSERT (formal_params_iter_p->current_value_p == NULL);
uint32_t param_index;
@@ -185,6 +185,8 @@ ecma_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function */
}
}
MEM_FINALIZE_LOCAL_ARRAY (formal_params);
// 12.
ecma_set_object_type (obj_p, ECMA_OBJECT_TYPE_ARGUMENTS);