aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-10 04:32:43 +0000
committerChris Lattner <sabre@nondot.org>2006-05-10 04:32:43 +0000
commitbb7ff6690f3b8da90a78ffe47576e11d1655b9c1 (patch)
tree023ebe975d57de9a2de1d58de31274c3d9c08a06 /llvm/lib
parent32982836b6407326d45c08a91e8ef0a06b5c9d5e (diff)
downloadllvm-bb7ff6690f3b8da90a78ffe47576e11d1655b9c1.zip
llvm-bb7ff6690f3b8da90a78ffe47576e11d1655b9c1.tar.gz
llvm-bb7ff6690f3b8da90a78ffe47576e11d1655b9c1.tar.bz2
Add an assertion for a common error
llvm-svn: 28210
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp5
1 files changed, 4 insertions, 1 deletions
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 @@ 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;
}