aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Instructions.cpp
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
commite46749cce0088a0aaa03bcb5786e94c6c11bced5 (patch)
treefc9e6c3f7252d745753edba3a822219aa123fd11 /lib/VMCore/Instructions.cpp
parent3eff89bf8967d35176fc1d3e80c1a5faf74fb9d8 (diff)
Add an assertion for a common error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index d3c7b54d2a..929e140928 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/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;
}