diff options
Diffstat (limited to 'lib/Support/SmallPtrSet.cpp')
-rw-r--r-- | lib/Support/SmallPtrSet.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Support/SmallPtrSet.cpp b/lib/Support/SmallPtrSet.cpp index e37e23b7bb..fa8d91545e 100644 --- a/lib/Support/SmallPtrSet.cpp +++ b/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"); |