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:
Andrey Shitov
2015-07-14 15:58:31 +03:00
parent 69655f4456
commit f3ef9afb91
+7 -3
View File
@@ -849,15 +849,19 @@ lexer_parse_number (void)
consume_char (); consume_char ();
consume_char (); consume_char ();
new_token (); new_token ();
while (true)
{
c = LA (0); c = LA (0);
if (!lit_char_is_hex_digit (c)) if (!lit_char_is_hex_digit (c))
{ {
break; PARSE_ERROR ("Invalid HexIntegerLiteral", lit_utf8_iterator_get_pos (&src_iter));
} }
do
{
consume_char (); 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))
{ {