summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/RewriteRope.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Rewrite/RewriteRope.cpp')
-rw-r--r--clang/lib/Rewrite/RewriteRope.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Rewrite/RewriteRope.cpp b/clang/lib/Rewrite/RewriteRope.cpp
index 7ee9fcced24..9d5d7a74105 100644
--- a/clang/lib/Rewrite/RewriteRope.cpp
+++ b/clang/lib/Rewrite/RewriteRope.cpp
@@ -567,10 +567,12 @@ void RopePieceBTreeInterior::erase(unsigned Offset, unsigned NumBytes) {
unsigned BytesFromChild = CurChild->size()-Offset;
CurChild->erase(Offset, BytesFromChild);
NumBytes -= BytesFromChild;
+ // Start at the beginning of the next child.
+ Offset = 0;
++i;
continue;
}
-
+
// If the deletion request completely covers the child, delete it and move
// the rest down.
NumBytes -= CurChild->size();
OpenPOWER on IntegriCloud