From a4c206febea2cd77571bd04f97353ff4e027e6e2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 29 Oct 2009 05:53:32 +0000 Subject: [PATCH] add sanity check for indbr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85496 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Instructions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 1e63436883c..52d8735d89b 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(Address->getType()) && + "Address of indirectbr must be a pointer"); ReservedSpace = 1+NumDests; NumOperands = 1; OperandList = allocHungoffUses(ReservedSpace);