optimize strstr, PR5783
[oota-llvm.git] / lib / VMCore / Verifier.cpp
index 7ab7b1516844d95091a2a0494fcee69ceb0c6c79..7aa86b776c76120268c392bf525bc79f2894bc07 100644 (file)
@@ -1475,6 +1475,9 @@ void Verifier::visitInstruction(Instruction &I) {
 void Verifier::VerifyType(const Type *Ty) {
   if (!Types.insert(Ty)) return;
 
+  Assert1(&Mod->getContext() == &Ty->getContext(),
+          "Type context does not match Module context!", Ty);
+
   switch (Ty->getTypeID()) {
   case Type::FunctionTyID: {
     const FunctionType *FTy = cast<FunctionType>(Ty);