diff options
author | Daniel Jasper <djasper@google.com> | 2015-01-29 10:47:14 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-01-29 10:47:14 +0000 |
commit | 47b35aeaa14567eb1b5ed82a73f575f18afe3fa5 (patch) | |
tree | e168e4dc9290a79f96f8f7a9e858c5ca262efb35 /clang/lib/Format/WhitespaceManager.cpp | |
parent | 310e3a8f608fbd9162e42cc50fe316af6713113c (diff) | |
download | llvm-47b35aeaa14567eb1b5ed82a73f575f18afe3fa5.zip llvm-47b35aeaa14567eb1b5ed82a73f575f18afe3fa5.tar.gz llvm-47b35aeaa14567eb1b5ed82a73f575f18afe3fa5.tar.bz2 |
clang-format: Fix crasher caused by not properly setting dry-run.
llvm-svn: 227427
Diffstat (limited to 'clang/lib/Format/WhitespaceManager.cpp')
-rw-r--r-- | clang/lib/Format/WhitespaceManager.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp index bf1207e..44e5f69 100644 --- a/clang/lib/Format/WhitespaceManager.cpp +++ b/clang/lib/Format/WhitespaceManager.cpp @@ -264,6 +264,11 @@ void WhitespaceManager::alignEscapedNewlines(unsigned Start, unsigned End, void WhitespaceManager::generateChanges() { for (unsigned i = 0, e = Changes.size(); i != e; ++i) { const Change &C = Changes[i]; + if (i > 0) { + assert(Changes[i - 1].OriginalWhitespaceRange.getBegin() != + C.OriginalWhitespaceRange.getBegin() && + "Generating two replacements for the same location"); + } if (C.CreateReplacement) { std::string ReplacementText = C.PreviousLinePostfix; if (C.ContinuesPPDirective) |