Skip to content

Commit bfc5bee

Browse files
authored
Restore deleted lines. (#1574)
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 [email protected]
1 parent be720b2 commit bfc5bee

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

jerry-core/ecma/base/ecma-property-hashmap.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,13 @@ ecma_property_hashmap_insert (ecma_object_t *object_p, /**< object */
310310
bits_p += (entry_index >> 3);
311311
mask = (uint32_t) (1 << (entry_index & 0x7));
312312

313-
hashmap_p->null_count--;
314-
JERRY_ASSERT (hashmap_p->null_count > 0);
313+
if (!(*bits_p & mask))
314+
{
315+
/* Deleted entries also has ECMA_NULL_POINTER
316+
* value, but they are not NULL values. */
317+
hashmap_p->null_count--;
318+
JERRY_ASSERT (hashmap_p->null_count > 0);
319+
}
315320

316321
hashmap_p->unused_count--;
317322
JERRY_ASSERT (hashmap_p->unused_count > 0);

jerry-core/parser/js/js-parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ parser_compute_indicies (parser_context_t *context_p, /**< context */
323323
{
324324
if (!(literal_p->status_flags & LEXER_FLAG_NO_REG_STORE))
325325
{
326-
JERRY_ASSERT (register_count < PARSER_MAXIMUM_NUMBER_OF_REGISTERS);
326+
JERRY_ASSERT (register_count <= PARSER_MAXIMUM_NUMBER_OF_REGISTERS);
327327
/* This var literal can be stored in a register. */
328328
literal_p->prop.index = register_index;
329329
register_index++;

0 commit comments

Comments
 (0)