diff options
author | Daniel Jasper <djasper@google.com> | 2013-05-30 06:40:07 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-05-30 06:40:07 +0000 |
commit | 51fb2b2151658e344174829044900778ec0036a5 (patch) | |
tree | 241a27f3a364751054f53ccdd6dbccacdc2b0df3 /clang/lib | |
parent | b33e8bcef8b3b5b962018d8d6eae08652afcf31e (diff) | |
download | bcm5719-llvm-51fb2b2151658e344174829044900778ec0036a5.tar.gz bcm5719-llvm-51fb2b2151658e344174829044900778ec0036a5.zip |
Fix crasher when formatting certain block comments.
Smallest reproduction:
/*
**
*/
llvm-svn: 182913
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Format/BreakableToken.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Format/BreakableToken.cpp b/clang/lib/Format/BreakableToken.cpp index 5c3ad9cee2b..10ba1f39a55 100644 --- a/clang/lib/Format/BreakableToken.cpp +++ b/clang/lib/Format/BreakableToken.cpp @@ -337,6 +337,11 @@ BreakableBlockComment::replaceWhitespaceBefore(unsigned LineIndex, // contain a trailing whitespace. Prefix = Prefix.substr(0, 1); } + } else { + if (StartOfLineColumn[LineIndex] == 1) { + // This lines starts immediately after the decorating *. + Prefix = Prefix.substr(0, 1); + } } unsigned WhitespaceOffsetInToken = |