Fix regex brackets matching bug (#2179)
Fixes #2178. JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan@inf.u-szeged.hu
This commit is contained in:
committed by
László Langó
parent
918eb22a01
commit
607e605844
@@ -318,7 +318,8 @@ re_parse_char_class (re_parser_ctx_t *parser_ctx_p, /**< number of classes */
|
||||
bool is_range = false;
|
||||
parser_ctx_p->num_of_classes = 0;
|
||||
|
||||
if (lit_utf8_peek_prev (parser_ctx_p->input_curr_p) != LIT_CHAR_LEFT_SQUARE)
|
||||
const ecma_char_t prev_char = lit_utf8_peek_prev (parser_ctx_p->input_curr_p);
|
||||
if (prev_char != LIT_CHAR_LEFT_SQUARE && prev_char != LIT_CHAR_CIRCUMFLEX)
|
||||
{
|
||||
lit_utf8_decr (&parser_ctx_p->input_curr_p);
|
||||
lit_utf8_decr (&parser_ctx_p->input_curr_p);
|
||||
|
||||
Reference in New Issue
Block a user