summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commit2b88c1e4c43838d570aca37fefd53a1c590604ad (patch)
treeb5f1e0c2b8f7722ce12e848cfed6e757cea0eec6 /clang/lib
parent78af38c392f63e58d3a6b60b8999d0344ec13b53 (diff)
downloadbcm5719-llvm-2b88c1e4c43838d570aca37fefd53a1c590604ad.tar.gz
bcm5719-llvm-2b88c1e4c43838d570aca37fefd53a1c590604ad.zip
Fix rdar://5919567: assertion failure: split didn't occur before erase!
llvm-svn: 50839
Diffstat (limited to 'clang/lib')
-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