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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195704 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth 2013-11-26 00:44:36 +00:00
parent 8037485f16
commit b30824e1b9

View File

@ -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");