Fix for PR2750; don't check for an 'e' in the trash after the token.

Note that this isn't really a complete fix; I think there are other 
potential overrun situations.  I don't really know what the best 
systematic fix is, though.

llvm-svn: 55622
This commit is contained in:
Eli Friedman 2008-09-02 05:29:22 +00:00
parent 7c9ba6a1e3
commit ee29c9c2fc
2 changed files with 14 additions and 1 deletions

View File

@ -224,7 +224,7 @@ NumericLiteralParser(const char *begin, const char *end,
saw_period = true;
s = SkipDigits(s);
}
if (*s == 'e' || *s == 'E') { // exponent
if (s != ThisTokEnd && (*s == 'e' || *s == 'E')) { // exponent
const char *Exponent = s;
s++;
saw_exponent = true;

View File

@ -0,0 +1,13 @@
/* RUN: clang -fsyntax-only -verify %s
*/
# define XRECORD(x, c_name) e##c (x, __LINE__)
void x() {
XRECORD (XRECORD (1, 1), 1);
}