Add a missing assertion that would have helped out Reid
authorChris Lattner <sabre@nondot.org>
Sat, 10 Jun 2006 04:16:23 +0000 (04:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 10 Jun 2006 04:16:23 +0000 (04:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28746 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Constants.cpp

index 3351385d0a9fa027cf7b80bccabb0f1e0b54e6bc..3b55b652c093dd63b7ea721e88dc3bc8f9acf896 100644 (file)
@@ -863,6 +863,8 @@ static ValueMap<char, Type, ConstantAggregateZero> AggZeroConstants;
 static char getValType(ConstantAggregateZero *CPZ) { return 0; }
 
 Constant *ConstantAggregateZero::get(const Type *Ty) {
+  assert((isa<StructType>(Ty) || isa<ArrayType>(Ty) || isa<PackedType>(Ty)) &&
+         "Cannot create an aggregate zero of non-aggregate type!");
   return AggZeroConstants.getOrCreate(Ty, 0);
 }