aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-11-17 23:02:14 +0000
committerTed Kremenek <kremenek@apple.com>2011-11-17 23:02:14 +0000
commitf24944953986ad1e0a78279e6c3288e15a7e2619 (patch)
tree138d4abb026b4defbbaf3dca860eab754014e5de /include
parent944d82ba06bcb6bf92ca1fbcbdf1a882cd009363 (diff)
downloadexternal_llvm-f24944953986ad1e0a78279e6c3288e15a7e2619.zip
external_llvm-f24944953986ad1e0a78279e6c3288e15a7e2619.tar.gz
external_llvm-f24944953986ad1e0a78279e6c3288e15a7e2619.tar.bz2
Fix bug in RefCountedBase/RefCountedBaseVPTR where the reference count was accidentally copied as part of the copy constructor. This could result in objects getting leaked because there reference count was too high.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144931 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/IntrusiveRefCntPtr.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/ADT/IntrusiveRefCntPtr.h b/include/llvm/ADT/IntrusiveRefCntPtr.h
index 2f6fd2b..8757f00 100644
--- a/include/llvm/ADT/IntrusiveRefCntPtr.h
+++ b/include/llvm/ADT/IntrusiveRefCntPtr.h
@@ -46,6 +46,7 @@ namespace llvm {
public:
RefCountedBase() : ref_cnt(0) {}
+ RefCountedBase(const RefCountedBase &) : ref_cnt(0) {}
void Retain() const { ++ref_cnt; }
void Release() const {
@@ -67,6 +68,8 @@ namespace llvm {
protected:
RefCountedBaseVPTR() : ref_cnt(0) {}
+ RefCountedBaseVPTR(const RefCountedBaseVPTR &) : ref_cnt(0) {}
+
virtual ~RefCountedBaseVPTR() {}
void Retain() const { ++ref_cnt; }