summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/RewriteRope.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-10-20 05:53:05 +0000
committerTed Kremenek <kremenek@apple.com>2009-10-20 05:53:05 +0000
commit988c5811ee2160841308d7be009cf9e7dda71ddd (patch)
tree0dd182a8bd48a35d851832a920441cbb636076b2 /clang/lib/Rewrite/RewriteRope.cpp
parentcbd395c8989de7d58a2d046cc1463cc62e402af5 (diff)
downloadbcm5719-llvm-988c5811ee2160841308d7be009cf9e7dda71ddd.tar.gz
bcm5719-llvm-988c5811ee2160841308d7be009cf9e7dda71ddd.zip
Revert 84601. Looks like it was causing failures on some systems.
llvm-svn: 84610
Diffstat (limited to 'clang/lib/Rewrite/RewriteRope.cpp')
-rw-r--r--clang/lib/Rewrite/RewriteRope.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Rewrite/RewriteRope.cpp b/clang/lib/Rewrite/RewriteRope.cpp
index bd99732dc87..30bbcfafb53 100644
--- a/clang/lib/Rewrite/RewriteRope.cpp
+++ b/clang/lib/Rewrite/RewriteRope.cpp
@@ -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);
}
OpenPOWER on IntegriCloud