diff options
author | Daniel Jasper <djasper@google.com> | 2013-05-14 10:44:17 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-05-14 10:44:17 +0000 |
commit | 089f78d9cc1192244c9884e0e60dd82d415d8138 (patch) | |
tree | 44b801da2785f77feb090e872b3f196b84e229a5 | |
parent | 84f5ddfacc59c5d4878cd47b7794e53dc8e2e9f9 (diff) | |
download | clang-089f78d9cc1192244c9884e0e60dd82d415d8138.tar.gz clang-089f78d9cc1192244c9884e0e60dd82d415d8138.tar.bz2 clang-089f78d9cc1192244c9884e0e60dd82d415d8138.tar.xz |
Fix uninitialized value bug found by valgrind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181779 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Format/TokenAnnotator.cpp | 2 | ||||
-rw-r--r-- | lib/Format/TokenAnnotator.h | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index 0f91b11033..11f81fd8ba 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -874,8 +874,6 @@ void TokenAnnotator::annotate(AnnotatedLine &Line) { Line.First.SpacesRequiredBefore = 1; Line.First.MustBreakBefore = Line.First.FormatTok.MustBreakBefore; Line.First.CanBreakBefore = Line.First.MustBreakBefore; - - Line.First.TotalLength = Line.First.FormatTok.TokenLength; } void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) { diff --git a/lib/Format/TokenAnnotator.h b/lib/Format/TokenAnnotator.h index 5ea30159a2..227dd52396 100644 --- a/lib/Format/TokenAnnotator.h +++ b/lib/Format/TokenAnnotator.h @@ -75,10 +75,11 @@ public: : FormatTok(FormatTok), Type(TT_Unknown), SpacesRequiredBefore(0), CanBreakBefore(false), MustBreakBefore(false), ClosesTemplateDeclaration(false), MatchingParen(NULL), - ParameterCount(0), BindingStrength(0), SplitPenalty(0), - LongestObjCSelectorName(0), DefinesFunctionType(false), Parent(NULL), - FakeRParens(0), LastInChainOfCalls(false), - PartOfMultiVariableDeclStmt(false), NoMoreTokensOnLevel(false) {} + ParameterCount(0), TotalLength(FormatTok.TokenLength), + BindingStrength(0), SplitPenalty(0), LongestObjCSelectorName(0), + DefinesFunctionType(false), Parent(NULL), FakeRParens(0), + LastInChainOfCalls(false), PartOfMultiVariableDeclStmt(false), + NoMoreTokensOnLevel(false) {} bool is(tok::TokenKind Kind) const { return FormatTok.Tok.is(Kind); } |