diff options
Diffstat (limited to 'clang/lib/Edit/EditedSource.cpp')
-rw-r--r-- | clang/lib/Edit/EditedSource.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Edit/EditedSource.cpp b/clang/lib/Edit/EditedSource.cpp index 5b7fa4ad1b6..b2a16635d05 100644 --- a/clang/lib/Edit/EditedSource.cpp +++ b/clang/lib/Edit/EditedSource.cpp @@ -100,8 +100,11 @@ bool EditedSource::commitInsertFromRange(SourceLocation OrigLoc, FileOffset B = I->first; FileOffset E = B.getWithOffset(FA.RemoveLen); + if (BeginOffs == B) + break; + if (BeginOffs < E) { - if (BeginOffs >= B) { + if (BeginOffs > B) { BeginOffs = E; ++I; } |