Fix hex sequence escape.

This commit is contained in:
Christoffer Lerno
2021-12-03 17:29:25 +01:00
parent cae1933f0f
commit e20e6071c8

View File

@@ -573,20 +573,12 @@ static inline int64_t scan_hex_literal(Lexer *lexer, int positions)
for (int j = 0; j < positions; j++) for (int j = 0; j < positions; j++)
{ {
hex <<= 4U; hex <<= 4U;
int i = char_to_nibble(next(lexer)); int i = char_to_nibble(peek(lexer));
if (i < 0) if (i < 0)
{ {
if (lexer->current[-1] == '\'')
{
backtrack(lexer);
return -1;
}
while (lexer->current[0] != '\'' && lexer->current[0] != '\0' && ++j < positions)
{
next(lexer);
}
return -1; return -1;
} }
next(lexer);
hex += i; hex += i;
} }
return hex; return hex;