diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-11-23 04:52:00 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-11-23 04:52:00 +0000 |
commit | 951cb61e2fc34e1f6c2324b9613985191e87fe49 (patch) | |
tree | 6404023ac4573ce85fe5f8ff344143f9ab5786f9 /lib | |
parent | 1df6ea033855b9c8ff66bdfc5f479fe8d2afb272 (diff) | |
download | external_llvm-951cb61e2fc34e1f6c2324b9613985191e87fe49.zip external_llvm-951cb61e2fc34e1f6c2324b9613985191e87fe49.tar.gz external_llvm-951cb61e2fc34e1f6c2324b9613985191e87fe49.tar.bz2 |
Start catching LLVMContext misuse in the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89646 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<FunctionType>(Ty); |