diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp index eed49c43833..b01270de727 100644 --- a/tools/llvm-link/llvm-link.cpp +++ b/tools/llvm-link/llvm-link.cpp @@ -246,8 +246,10 @@ public: Module &ModuleLazyLoaderCache::operator()(const char *argv0, const std::string &Identifier) { auto &Module = ModuleMap[Identifier]; - if (!Module) + if (!Module) { Module = createLazyModule(argv0, Identifier); + assert(Module && "Failed to create lazy module!"); + } return *Module; } } // anonymous namespace