From 0955cb41ebc5bb0e12b991d24f94b3628c399b24 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Thu, 29 Jan 2015 13:11:47 +0000 Subject: [PATCH] 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. llvm-svn: 227433 --- clang/lib/Format/Format.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 2a4721f..128a5a7 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -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; } -- 2.7.4