Add assertion to check for
authorChris Lattner <sabre@nondot.org>
Fri, 7 Sep 2001 16:25:42 +0000 (16:25 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 7 Sep 2001 16:25:42 +0000 (16:25 +0000)
alloca [int]
for example

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@429 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/iMemory.h

index 5062cb61af4907bec06b9884c5c6727aea36fe77..5667da6c8ff1428c4e69a9f201cd80def8720563 100644 (file)
@@ -33,6 +33,11 @@ public:
 
       Operands.reserve(1);
       Operands.push_back(Use(ArraySize, this));
+    } else {
+      // Make sure that the pointer is not to an unsized array!
+      assert(!getType()->getValueType()->isArrayType() ||
+            ((const ArrayType*)getType()->getValueType())->isSized() && 
+            "Trying to allocate unsized array without size!");
     }
   }