Add an assertion for a common error
llvm-svn: 28210
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index d3c7b54..929e140 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -505,9 +505,12 @@
static Value *getAISize(Value *Amt) {
if (!Amt)
Amt = ConstantUInt::get(Type::UIntTy, 1);
- else
+ else {
+ assert(!isa<BasicBlock>(Amt) &&
+ "Passed basic block into allocation size parameter! Ue other ctor");
assert(Amt->getType() == Type::UIntTy &&
"Malloc/Allocation array size != UIntTy!");
+ }
return Amt;
}