aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/RewriteRope.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-05-08 03:23:46 +0000
committerChris Lattner <sabre@nondot.org>2008-05-08 03:23:46 +0000
commitb6403af3e697f90308fe8daf82f7b15252d198bc (patch)
tree67ced15528a610883bcd2d6aa82009e4ac7e1f0c /lib/Rewrite/RewriteRope.cpp
parent5cada6bd7f0a9f1c0f82613924610177d676ced5 (diff)
Fix rdar://5919567: assertion failure: split didn't occur before erase!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50839 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteRope.cpp')
-rw-r--r--lib/Rewrite/RewriteRope.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Rewrite/RewriteRope.cpp b/lib/Rewrite/RewriteRope.cpp
index 7ee9fcced2..9d5d7a7410 100644
--- a/lib/Rewrite/RewriteRope.cpp
+++ b/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();