aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-29 05:53:32 +0000
committerChris Lattner <sabre@nondot.org>2009-10-29 05:53:32 +0000
commita4c206febea2cd77571bd04f97353ff4e027e6e2 (patch)
tree2b214b54fb73c234a4f4a319e516350256b61415
parentb3d5a65d94ca017570fe86578423186c6a2f642e (diff)
add sanity check for indbr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85496 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Instructions.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 1e63436883..52d8735d89 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -3091,7 +3091,8 @@ void SwitchInst::setSuccessorV(unsigned idx, BasicBlock *B) {
//===----------------------------------------------------------------------===//
void IndirectBrInst::init(Value *Address, unsigned NumDests) {
- assert(Address);
+ assert(Address && isa<PointerType>(Address->getType()) &&
+ "Address of indirectbr must be a pointer");
ReservedSpace = 1+NumDests;
NumOperands = 1;
OperandList = allocHungoffUses(ReservedSpace);