Fix a bug in SmallPtrSet that was causing GVNPRE to enter an infinite loop.
authorOwen Anderson <resistor@mac.com>
Fri, 22 Jun 2007 00:11:18 +0000 (00:11 +0000)
committerOwen Anderson <resistor@mac.com>
Fri, 22 Jun 2007 00:11:18 +0000 (00:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37697 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/SmallPtrSet.cpp

index 56c5e3d18a2caf0dd4f8a2e1ca5ef0e8976bd77b..da1a11029e79dea9f828bc5eb05ff2c9d8fa0565 100644 (file)
@@ -154,7 +154,7 @@ SmallPtrSetImpl::SmallPtrSetImpl(const SmallPtrSetImpl& that) {
     // terminator.
     memcpy(CurArray, that.CurArray, sizeof(void*)*(CurArraySize+1));
   } else {
-    CurArraySize = that.NumElements < 64 ? 128 : that.NumElements*2;
+    CurArraySize = that.NumElements < 64 ? 128 : that.CurArraySize*2;
     CurArray = new void*[CurArraySize+1];
     memset(CurArray, -1, CurArraySize*sizeof(void*));