From: Ian Lance Taylor Date: Mon, 7 May 2012 18:53:28 +0000 (+0000) Subject: compiler: fix an ICE when parsing 0xdie, reject token 0x123i. X-Git-Tag: misc/gccgo-go1_1_2~3039 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62beea506bd1a5c688e7b88457408411c8272635;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/go/gofrontend/lex.cc b/gcc/go/gofrontend/lex.cc index 53618fc72cad..5b7ce6869e6c 100644 --- a/gcc/go/gofrontend/lex.cc +++ b/gcc/go/gofrontend/lex.cc @@ -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); mpz_t val;