Commit 62beea50 by Ian Lance Taylor

compiler: fix an ICE when parsing 0xdie, reject token 0x123i.

The lexer used to incorrectly accept a token like 0x123i
and interpreted it as 123i. It also used to die when encountering
0xdie.

From-SVN: r187266
parent ca30ba74
...@@ -1012,7 +1012,9 @@ Lex::gather_number() ...@@ -1012,7 +1012,9 @@ Lex::gather_number()
} }
} }
if (*p != '.' && *p != 'i' && !Lex::could_be_exponent(p, pend)) // A partial token that looks like an octal literal might actually be the
// beginning of a floating-point or imaginary literal.
if (base == 16 || (*p != '.' && *p != 'i' && !Lex::could_be_exponent(p, pend)))
{ {
std::string s(pnum, p - pnum); std::string s(pnum, p - pnum);
mpz_t val; mpz_t val;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment