Add an assertion for a common error

llvm-svn: 28210
This commit is contained in:
Chris Lattner 2006-05-10 04:32:43 +00:00
parent 32982836b6
commit bb7ff6690f
1 changed files with 4 additions and 1 deletions

View File

@ -505,9 +505,12 @@ void BranchInst::setSuccessorV(unsigned idx, BasicBlock *B) {
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;
}