diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 07428fdac7b..61257187f52 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -523,6 +523,13 @@ Action::ExprResult Sema::ActOnNumericConstant(const Token &Tok) { // Get the spelling of the token, which eliminates trigraphs, etc. unsigned ActualLength = PP.getSpelling(Tok, ThisTokBegin); + + // Add padding so that NumericLiteralParser can overread by one character. + if (!IntegerBuffer.empty()) { + IntegerBuffer.push_back(' '); + ThisTokBegin = &IntegerBuffer[0]; + } + NumericLiteralParser Literal(ThisTokBegin, ThisTokBegin+ActualLength, Tok.getLocation(), PP); if (Literal.hadError) |