Fix handling of invalid HexIntegerLiterals in lexer.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
@@ -849,16 +849,20 @@ lexer_parse_number (void)
|
|||||||
consume_char ();
|
consume_char ();
|
||||||
consume_char ();
|
consume_char ();
|
||||||
new_token ();
|
new_token ();
|
||||||
while (true)
|
|
||||||
|
c = LA (0);
|
||||||
|
if (!lit_char_is_hex_digit (c))
|
||||||
{
|
{
|
||||||
c = LA (0);
|
PARSE_ERROR ("Invalid HexIntegerLiteral", lit_utf8_iterator_get_pos (&src_iter));
|
||||||
if (!lit_char_is_hex_digit (c))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
consume_char ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
consume_char ();
|
||||||
|
c = LA (0);
|
||||||
|
}
|
||||||
|
while (lit_char_is_hex_digit (c));
|
||||||
|
|
||||||
if (lexer_is_char_can_be_identifier_start (c))
|
if (lexer_is_char_can_be_identifier_start (c))
|
||||||
{
|
{
|
||||||
PARSE_ERROR ("Identifier just after integer literal", lit_utf8_iterator_get_pos (&src_iter));
|
PARSE_ERROR ("Identifier just after integer literal", lit_utf8_iterator_get_pos (&src_iter));
|
||||||
|
|||||||
Reference in New Issue
Block a user