From 3364abbb36ea666ef72351bec890064ab1ed063f Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 9 Jul 2007 20:59:01 +0000 Subject: Make the assignment operator for SmallPtrSet return a reference, and fix a long-standing bug in the copy ctor while I'm at it. Thanks to Chris Lattner for help with this patch. llvm-svn: 38470 --- llvm/lib/Support/SmallPtrSet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Support/SmallPtrSet.cpp') diff --git a/llvm/lib/Support/SmallPtrSet.cpp b/llvm/lib/Support/SmallPtrSet.cpp index 5ad243033fc..e8e530fceed 100644 --- a/llvm/lib/Support/SmallPtrSet.cpp +++ b/llvm/lib/Support/SmallPtrSet.cpp @@ -164,7 +164,7 @@ SmallPtrSetImpl::SmallPtrSetImpl(const SmallPtrSetImpl& that) { CurArray[CurArraySize] = 0; // Copy over all valid entries. - for (void **BucketPtr = that.CurArray, **E = that.CurArray+CurArraySize; + for (void **BucketPtr = that.CurArray, **E = that.CurArray+that.CurArraySize; BucketPtr != E; ++BucketPtr) { // Copy over the element if it is valid. void *Elt = *BucketPtr; -- cgit v1.2.3