Decrementing "begin()" makes sanitizer sad. This fix makes sure "I" is never decremented when it is the "begin".
On Wed, Sep 28, 2016 at 3:10 PM Manuel Klimek <kli...@google.com> wrote: > On Wed, Sep 28, 2016 at 2:58 PM Eric Liu via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > > Author: ioeric > Date: Wed Sep 28 07:49:14 2016 > New Revision: 282583 > > URL: http://llvm.org/viewvc/llvm-project?rev=282583&view=rev > Log: > Trying to buildbot failures caused by r282577. > > > A bit more explanation of what failed, and why this fixes it, would be > nice in the future :) > > > > Modified: > cfe/trunk/lib/Tooling/Core/Replacement.cpp > > Modified: cfe/trunk/lib/Tooling/Core/Replacement.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Core/Replacement.cpp?rev=282583&r1=282582&r2=282583&view=diff > > ============================================================================== > --- cfe/trunk/lib/Tooling/Core/Replacement.cpp (original) > +++ cfe/trunk/lib/Tooling/Core/Replacement.cpp Wed Sep 28 07:49:14 2016 > @@ -287,8 +287,13 @@ llvm::Error Replacements::add(const Repl > // 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<Replacements> Merged = > OverlapReplaces.mergeIfOrderIndependent(R); > > > _______________________________________________ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits