From ab75fd0694e7e5bc3d23926fbe7e73198aee03b1 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 11 Nov 2014 23:13:10 +0000 Subject: [PATCH] libLTO: Assert if LTOCodeGenerator and LTOModule are from different contexts git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221730 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/LTO/LTOCodeGenerator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp index 31ab3401c9d..c663d43fe7f 100644 --- a/lib/LTO/LTOCodeGenerator.cpp +++ b/lib/LTO/LTOCodeGenerator.cpp @@ -128,6 +128,9 @@ void LTOCodeGenerator::initializeLTOPasses() { } bool LTOCodeGenerator::addModule(LTOModule *mod) { + assert(&mod->getModule().getContext() == &Context && + "Expected module in same context"); + bool ret = IRLinker.linkInModule(&mod->getModule()); const std::vector &undefs = mod->getAsmUndefinedRefs();