summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-09-30 20:53:45 +0000
committerChris Lattner <sabre@nondot.org>2008-09-30 20:53:45 +0000
commita1cf5f9663170c9a0255562cfe4efd5fa1af1c3b (patch)
treece7e1c3f7360c612f501a42e61a88079b16cb76b /clang/lib/Sema/SemaExpr.cpp
parent8b567f971345c8f5527277042124274bb62c675e (diff)
downloadbcm5719-llvm-a1cf5f9663170c9a0255562cfe4efd5fa1af1c3b.tar.gz
bcm5719-llvm-a1cf5f9663170c9a0255562cfe4efd5fa1af1c3b.zip
simplify padding, just fold it into the earlier resize.
llvm-svn: 56880
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-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