Merging r258729:
[oota-llvm.git] / lib / Support / SmallVector.cpp
index f9c0e78270c9195a23e83498b4e1489474c3f4b0..b931505bd6a133d8d01dfcddba396e802b5e6fb2 100644 (file)
@@ -33,6 +33,7 @@ void SmallVectorBase::grow_pod(void *FirstEl, size_t MinSizeInBytes,
     // If this wasn't grown from the inline copy, grow the allocated space.
     NewElts = realloc(this->BeginX, NewCapacityInBytes);
   }
+  assert(NewElts && "Out of memory");
 
   this->EndX = (char*)NewElts+CurSizeBytes;
   this->BeginX = NewElts;