Fix incorrect assertion in parser_parse_for_statement_start (#3679)

This patch fixes #3655.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-04-21 12:00:39 +02:00
committed by GitHub
parent 3900152631
commit d1bf9635c7
4 changed files with 36 additions and 1 deletions
+6 -1
View File
@@ -1314,7 +1314,12 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
parser_emit_cbc_ext (context_p, is_for_in ? CBC_EXT_FOR_IN_GET_NEXT
: CBC_EXT_FOR_OF_GET_NEXT);
#if ENABLED (JERRY_ES2015)
JERRY_ASSERT (literal_index < PARSER_REGISTER_START || !has_context);
#ifndef JERRY_NDEBUG
if (literal_index >= PARSER_REGISTER_START && has_context)
{
context_p->global_status_flags |= ECMA_PARSE_INTERNAL_FOR_IN_OFF_CONTEXT_ERROR;
}
#endif /* !JERRY_NDEBUG */
parser_emit_cbc_literal (context_p,
has_context ? CBC_ASSIGN_LET_CONST : CBC_ASSIGN_SET_IDENT,
+1
View File
@@ -2100,6 +2100,7 @@ parser_parse_source (const uint8_t *arg_list_p, /**< function argument list */
#ifndef JERRY_NDEBUG
JERRY_ASSERT (context.status_flags & PARSER_SCANNING_SUCCESSFUL);
JERRY_ASSERT (!(context.global_status_flags & ECMA_PARSE_INTERNAL_FOR_IN_OFF_CONTEXT_ERROR));
context.status_flags &= (uint32_t) ~PARSER_SCANNING_SUCCESSFUL;
#endif /* !JERRY_NDEBUG */