diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 7ab7b151684..7aa86b776c7 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -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(Ty);