Don't use ecma_create_named_data_property in fast mode arrays (#3042)

Remove invalid use of named data properties in fast mode arrays.
Fixes #3040

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2019-09-03 20:43:41 +03:00
committed by Robert Fancsik
parent e79059c94b
commit 14e4476084
3 changed files with 32 additions and 6 deletions
+6
View File
@@ -335,6 +335,9 @@ ecma_create_property (ecma_object_t *object_p, /**< the object */
JERRY_ASSERT (ECMA_PROPERTY_PAIR_ITEM_COUNT == 2);
JERRY_ASSERT (name_p != NULL);
JERRY_ASSERT (object_p != NULL);
JERRY_ASSERT (ecma_is_lexical_environment (object_p)
|| ecma_get_object_type (object_p) != ECMA_OBJECT_TYPE_ARRAY
|| !((ecma_extended_object_t *) object_p)->u.array.is_fast_mode);
jmem_cpointer_t *property_list_head_p = &object_p->u1.property_list_cp;
@@ -686,6 +689,9 @@ ecma_get_named_data_property (ecma_object_t *obj_p, /**< object to find property
{
JERRY_ASSERT (obj_p != NULL);
JERRY_ASSERT (name_p != NULL);
JERRY_ASSERT (ecma_is_lexical_environment (obj_p)
|| ecma_get_object_type (obj_p) != ECMA_OBJECT_TYPE_ARRAY
|| !((ecma_extended_object_t *) obj_p)->u.array.is_fast_mode);
ecma_property_t *property_p = ecma_find_named_property (obj_p, name_p);