If a literal was assigned the unused flag it wasn't freed, however it could have been not empty, therefore should've been freed.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2017-08-30 12:20:13 +02:00
committed by yichoi
parent 7ccbe97b79
commit a51def40e7
2 changed files with 27 additions and 0 deletions
+7
View File
@@ -164,6 +164,13 @@ parser_compute_indicies (parser_context_t *context_p, /**< context */
{
if (literal_p->status_flags & LEXER_FLAG_UNUSED_IDENT)
{
#ifndef PARSER_DUMP_BYTE_CODE
if (!(literal_p->status_flags & LEXER_FLAG_SOURCE_PTR))
{
jmem_heap_free_block ((void *) literal_p->u.char_p, literal_p->prop.length);
}
#endif /* !PARSER_DUMP_BYTE_CODE */
context_p->literal_count--;
continue;
}