[llvm-commits] [llvm] r85496 - /llvm/trunk/lib/VMCore/Instructions.cpp

Chris Lattner sabre at nondot.org
Wed Oct 28 22:53:33 PDT 2009


Author: lattner
Date: Thu Oct 29 00:53:32 2009
New Revision: 85496

URL: http://llvm.org/viewvc/llvm-project?rev=85496&view=rev
Log:
add sanity check for indbr.

Modified:
    llvm/trunk/lib/VMCore/Instructions.cpp

Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=85496&r1=85495&r2=85496&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Thu Oct 29 00:53:32 2009
@@ -3091,7 +3091,8 @@
 //===----------------------------------------------------------------------===//
 
 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);





More information about the llvm-commits mailing list