r227433 - clang-format: FIXME that led to access of uninitialized memory.

Daniel Jasper djasper at google.com
Thu Jan 29 05:11:47 PST 2015


Author: djasper
Date: Thu Jan 29 07:11:47 2015
New Revision: 227433

URL: http://llvm.org/viewvc/llvm-project?rev=227433&view=rev
Log:
clang-format: FIXME that led to access of uninitialized memory.

I have so far not succeeded in finding a nicely reduced test case or an
observable difference which could help me create a test failure without
msan.

Committing without test to unblock kcc's further fuzzing progress.

Modified:
    cfe/trunk/lib/Format/Format.cpp

Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=227433&r1=227432&r2=227433&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Thu Jan 29 07:11:47 2015
@@ -845,8 +845,8 @@ private:
   FormatToken *getNextToken() {
     if (GreaterStashed) {
       // Create a synthesized second '>' token.
-      // FIXME: Increment Column and set OriginalColumn.
       Token Greater = FormatTok->Tok;
+      unsigned OriginalColumn = FormatTok->OriginalColumn;
       FormatTok = new (Allocator.Allocate()) FormatToken;
       FormatTok->Tok = Greater;
       SourceLocation GreaterLocation =
@@ -855,6 +855,7 @@ private:
           SourceRange(GreaterLocation, GreaterLocation);
       FormatTok->TokenText = ">";
       FormatTok->ColumnWidth = 1;
+      FormatTok->OriginalColumn = OriginalColumn;
       GreaterStashed = false;
       return FormatTok;
     }





More information about the cfe-commits mailing list