forked from OSchip/llvm-project
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
This commit is contained in:
parent
30f5336ba8
commit
2664317b66
|
@ -218,6 +218,9 @@ SmallPtrSetImpl::SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize,
|
||||||
/// CopyFrom - implement operator= from a smallptrset that has the same pointer
|
/// CopyFrom - implement operator= from a smallptrset that has the same pointer
|
||||||
/// type, but may have a different small size.
|
/// type, but may have a different small size.
|
||||||
void SmallPtrSetImpl::CopyFrom(const SmallPtrSetImpl &RHS) {
|
void SmallPtrSetImpl::CopyFrom(const SmallPtrSetImpl &RHS) {
|
||||||
|
if (&RHS == this)
|
||||||
|
return;
|
||||||
|
|
||||||
if (isSmall() && RHS.isSmall())
|
if (isSmall() && RHS.isSmall())
|
||||||
assert(CurArraySize == RHS.CurArraySize &&
|
assert(CurArraySize == RHS.CurArraySize &&
|
||||||
"Cannot assign sets with different small sizes");
|
"Cannot assign sets with different small sizes");
|
||||||
|
|
Loading…
Reference in New Issue