[cfe-commits] r50839 - /cfe/trunk/lib/Rewrite/RewriteRope.cpp

Chris Lattner sabre at nondot.org
Wed May 7 20:23:49 PDT 2008


Author: lattner
Date: Wed May  7 22:23:46 2008
New Revision: 50839

URL: http://llvm.org/viewvc/llvm-project?rev=50839&view=rev
Log:
Fix rdar://5919567: assertion failure: split didn't occur before erase!

Modified:
    cfe/trunk/lib/Rewrite/RewriteRope.cpp

Modified: cfe/trunk/lib/Rewrite/RewriteRope.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteRope.cpp?rev=50839&r1=50838&r2=50839&view=diff

==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteRope.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteRope.cpp Wed May  7 22:23:46 2008
@@ -567,10 +567,12 @@
       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();





More information about the cfe-commits mailing list