Invalid regexp patterns should not throw syntax error during parsing (#4038)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-07-27 09:28:26 +02:00
committed by GitHub
parent da5b058dec
commit 11c2ae30d1
11 changed files with 175 additions and 36 deletions
+3 -3
View File
@@ -393,7 +393,7 @@ parser_emit_cbc_push_number (parser_context_t *context_p, /**< context */
bool is_negative_number) /**< sign is negative */
{
uint16_t value = context_p->lit_object.index;
uint16_t lit_value = UINT16_MAX;
uint16_t lit_value = PARSER_INVALID_LITERAL_INDEX;
if (context_p->last_cbc_opcode != PARSER_CBC_UNAVAILABLE)
{
@@ -420,7 +420,7 @@ parser_emit_cbc_push_number (parser_context_t *context_p, /**< context */
if (value == 0)
{
if (lit_value == UINT16_MAX)
if (lit_value == PARSER_INVALID_LITERAL_INDEX)
{
context_p->last_cbc_opcode = CBC_PUSH_NUMBER_0;
return;
@@ -433,7 +433,7 @@ parser_emit_cbc_push_number (parser_context_t *context_p, /**< context */
uint16_t opcode;
if (lit_value == UINT16_MAX)
if (lit_value == PARSER_INVALID_LITERAL_INDEX)
{
opcode = (is_negative_number ? CBC_PUSH_NUMBER_NEG_BYTE
: CBC_PUSH_NUMBER_POS_BYTE);