From 3cee4ab6f5da8d56ff42b10c6715c0f7774c5d94 Mon Sep 17 00:00:00 2001 From: Zoltan Herczeg Date: Thu, 9 Feb 2017 23:47:16 -0800 Subject: [PATCH] Restore deleted lines. In a previous patch the original null count behaviour of the property hashmap is just only partially restored. Now it is restored fully Also another assertion was forgot to be fixed in another patch, and we do so now. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com --- jerry-core/ecma/base/ecma-property-hashmap.c | 9 +++++++-- jerry-core/parser/js/js-parser.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/jerry-core/ecma/base/ecma-property-hashmap.c b/jerry-core/ecma/base/ecma-property-hashmap.c index 97c3fd234b..d9c0047d10 100644 --- a/jerry-core/ecma/base/ecma-property-hashmap.c +++ b/jerry-core/ecma/base/ecma-property-hashmap.c @@ -310,8 +310,13 @@ ecma_property_hashmap_insert (ecma_object_t *object_p, /**< object */ bits_p += (entry_index >> 3); mask = (uint32_t) (1 << (entry_index & 0x7)); - hashmap_p->null_count--; - JERRY_ASSERT (hashmap_p->null_count > 0); + if (!(*bits_p & mask)) + { + /* Deleted entries also has ECMA_NULL_POINTER + * value, but they are not NULL values. */ + hashmap_p->null_count--; + JERRY_ASSERT (hashmap_p->null_count > 0); + } hashmap_p->unused_count--; JERRY_ASSERT (hashmap_p->unused_count > 0); diff --git a/jerry-core/parser/js/js-parser.c b/jerry-core/parser/js/js-parser.c index 922afabb2a..11beda7032 100644 --- a/jerry-core/parser/js/js-parser.c +++ b/jerry-core/parser/js/js-parser.c @@ -323,7 +323,7 @@ parser_compute_indicies (parser_context_t *context_p, /**< context */ { if (!(literal_p->status_flags & LEXER_FLAG_NO_REG_STORE)) { - JERRY_ASSERT (register_count < PARSER_MAXIMUM_NUMBER_OF_REGISTERS); + JERRY_ASSERT (register_count <= PARSER_MAXIMUM_NUMBER_OF_REGISTERS); /* This var literal can be stored in a register. */ literal_p->prop.index = register_index; register_index++;