Skip to content

Commit

Permalink
Fix bad iterator access.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248375 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
djasper-gh committed Sep 23, 2015
1 parent 575a21a commit 0f5f6df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Tooling/Core/Replacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ Replacements mergeReplacements(const Replacements &First,
for (auto FirstI = First.begin(), SecondI = Second.begin();
FirstI != First.end() || SecondI != Second.end();) {
bool NextIsFirst = SecondI == Second.end() ||
FirstI->getOffset() < SecondI->getOffset() + Delta;
(FirstI != First.end() &&
FirstI->getOffset() < SecondI->getOffset() + Delta);
MergedReplacement Merged(NextIsFirst ? *FirstI : *SecondI, NextIsFirst,
Delta);
++(NextIsFirst ? FirstI : SecondI);
Expand Down

0 comments on commit 0f5f6df

Please sign in to comment.