summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 61257187f52..fa18ce313e4 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -518,18 +518,13 @@ Action::ExprResult Sema::ActOnNumericConstant(const Token &Tok) {
Tok.getLocation()));
}
llvm::SmallString<512> IntegerBuffer;
- IntegerBuffer.resize(Tok.getLength());
+ // Add padding so that NumericLiteralParser can overread by one character.
+ IntegerBuffer.resize(Tok.getLength()+1);
const char *ThisTokBegin = &IntegerBuffer[0];
// 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)
OpenPOWER on IntegriCloud