Skip to content

Commit 890a1d1

Browse files
committed
Start catching LLVMContext misuse in the verifier.
llvm-svn: 89646
1 parent 15a1287 commit 890a1d1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/VMCore/Verifier.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,9 @@ void Verifier::visitInstruction(Instruction &I) {
14751475
void Verifier::VerifyType(const Type *Ty) {
14761476
if (!Types.insert(Ty)) return;
14771477

1478+
Assert1(&Mod->getContext() == &Ty->getContext(),
1479+
"Type context does not match Module context!", Ty);
1480+
14781481
switch (Ty->getTypeID()) {
14791482
case Type::FunctionTyID: {
14801483
const FunctionType *FTy = cast<FunctionType>(Ty);

0 commit comments

Comments
 (0)