From: Eric Liu Date: Wed, 28 Sep 2016 12:49:14 +0000 (+0000) Subject: Trying to buildbot failures caused by r282577. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd7faec9cac373b1f472933970162b4ba3fd7e42;p=platform%2Fupstream%2Fllvm.git Trying to buildbot failures caused by r282577. llvm-svn: 282583 --- diff --git a/clang/lib/Tooling/Core/Replacement.cpp b/clang/lib/Tooling/Core/Replacement.cpp index 9184883..7a5fb85 100644 --- a/clang/lib/Tooling/Core/Replacement.cpp +++ b/clang/lib/Tooling/Core/Replacement.cpp @@ -287,8 +287,13 @@ llvm::Error Replacements::add(const Replacement &R) { // with them and replace them with the merged replacements. auto MergeBegin = I; auto MergeEnd = std::next(I); - while (I-- != Replaces.begin() && Overlap(R, *I)) + while (I != Replaces.begin()) { + --I; + // If `I` doesn't overlap with `R`, don't merge it. + if (!Overlap(R, *I)) + break; MergeBegin = I; + } Replacements OverlapReplaces(MergeBegin, MergeEnd); llvm::Expected Merged = OverlapReplaces.mergeIfOrderIndependent(R);