]> granicus.if.org Git - clang/commitdiff
Revert 84601. Looks like it was causing failures on some systems.
authorTed Kremenek <kremenek@apple.com>
Tue, 20 Oct 2009 05:53:05 +0000 (05:53 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 20 Oct 2009 05:53:05 +0000 (05:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84610 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/RewriteRope.cpp

index bd99732dc872cbc0b3308fff07c4e12d8a3e6c96..30bbcfafb5321e8cedeb48a44e0c7e69cd0c03f8 100644 (file)
@@ -798,8 +798,9 @@ RopePiece RewriteRope::MakeRopeString(const char *Start, const char *End) {
   memcpy(AllocBuffer->Data, Start, Len);
   AllocOffs = Len;
 
-  // Return a RopePiece that wraps 'AllocBuffer'.  The constructor of RopePiece
-  // will increment the reference count of AllocBuffer.
+  // Start out the new allocation with a refcount of 1, since we have an
+  // internal reference to it.
+  AllocBuffer->addRef();
   return RopePiece(AllocBuffer, 0, Len);
 }