]> granicus.if.org Git - clang/commitdiff
Fix rdar://5919567: assertion failure: split didn't occur before erase!
authorChris Lattner <sabre@nondot.org>
Thu, 8 May 2008 03:23:46 +0000 (03:23 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 8 May 2008 03:23:46 +0000 (03:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50839 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/RewriteRope.cpp

index 7ee9fcced242aaef444ecd349dfae639dc1c2e21..9d5d7a741053f468df7d3f74586602346a290f80 100644 (file)
@@ -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();