From 951cb61e2fc34e1f6c2324b9613985191e87fe49 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 23 Nov 2009 04:52:00 +0000 Subject: Start catching LLVMContext misuse in the verifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89646 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Verifier.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/VMCore') diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 7ab7b15..7aa86b7 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); -- cgit v1.1