diff options
| author | Manuel Klimek <klimek@google.com> | 2013-05-30 07:45:53 +0000 |
|---|---|---|
| committer | Manuel Klimek <klimek@google.com> | 2013-05-30 07:45:53 +0000 |
| commit | 8910d192d004b543a2dc6d60cbb3722e08f611bc (patch) | |
| tree | 4e96a1991c317b4d780e69cac3affbeda0a9a717 /clang/lib/Format | |
| parent | a8b41762e40d1899e5f1fe25e52fc9a8d7e00eb8 (diff) | |
| download | bcm5719-llvm-8910d192d004b543a2dc6d60cbb3722e08f611bc.tar.gz bcm5719-llvm-8910d192d004b543a2dc6d60cbb3722e08f611bc.zip | |
Add asserts to guard against regressions.
llvm-svn: 182916
Diffstat (limited to 'clang/lib/Format')
| -rw-r--r-- | clang/lib/Format/BreakableToken.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/BreakableToken.cpp b/clang/lib/Format/BreakableToken.cpp index 10ba1f39a55..01317dbef3d 100644 --- a/clang/lib/Format/BreakableToken.cpp +++ b/clang/lib/Format/BreakableToken.cpp @@ -316,6 +316,7 @@ void BreakableBlockComment::insertBreak(unsigned LineIndex, unsigned TailOffset, unsigned BreakOffsetInToken = Text.data() - Tok.TokenText.data() + Split.first; unsigned CharsToRemove = Split.second; + assert(IndentAtLineBreak >= Decoration.size()); Whitespaces.breakToken(Tok, BreakOffsetInToken, CharsToRemove, "", Prefix, InPPDirective, IndentAtLineBreak - Decoration.size()); } @@ -347,6 +348,7 @@ BreakableBlockComment::replaceWhitespaceBefore(unsigned LineIndex, unsigned WhitespaceOffsetInToken = Lines[LineIndex].data() - Tok.TokenText.data() - LeadingWhitespace[LineIndex]; + assert(StartOfLineColumn[LineIndex] >= Prefix.size()); Whitespaces.breakToken( Tok, WhitespaceOffsetInToken, LeadingWhitespace[LineIndex], "", Prefix, InPPDirective, StartOfLineColumn[LineIndex] - Prefix.size()); |

