diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-11-26 00:44:36 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-11-26 00:44:36 +0000 |
commit | 2664317b66283e149bd436c14659c283f17bba3a (patch) | |
tree | 0ef85d48b885425644ffea294d4c0cc314a38fc6 /llvm/lib/Support/SmallPtrSet.cpp | |
parent | 30f5336ba87ba26b1cd50f038bab3ca9d2fa74d1 (diff) | |
download | bcm5719-llvm-2664317b66283e149bd436c14659c283f17bba3a.tar.gz bcm5719-llvm-2664317b66283e149bd436c14659c283f17bba3a.zip |
Fix a self-memcpy which only breaks under Valgrind's memcpy
implementation. Silliness, but it'll be a trivial performance
optimization. This should clear up a failure on the vg_leak bot.
llvm-svn: 195704
Diffstat (limited to 'llvm/lib/Support/SmallPtrSet.cpp')
-rw-r--r-- | llvm/lib/Support/SmallPtrSet.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Support/SmallPtrSet.cpp b/llvm/lib/Support/SmallPtrSet.cpp index e37e23b7bb1..fa8d91545e7 100644 --- a/llvm/lib/Support/SmallPtrSet.cpp +++ b/llvm/lib/Support/SmallPtrSet.cpp @@ -218,6 +218,9 @@ SmallPtrSetImpl::SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize, /// CopyFrom - implement operator= from a smallptrset that has the same pointer /// type, but may have a different small size. void SmallPtrSetImpl::CopyFrom(const SmallPtrSetImpl &RHS) { + if (&RHS == this) + return; + if (isSmall() && RHS.isSmall()) assert(CurArraySize == RHS.CurArraySize && "Cannot assign sets with different small sizes"); |