diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp index e5796a69ca66d..a7d3ca5fe2b1d 100644 --- a/lib/Serialization/Deserialization.cpp +++ b/lib/Serialization/Deserialization.cpp @@ -3113,7 +3113,8 @@ ModuleDecl *ModuleFile::getModule(ImportPath::Module name, name.front().Item == getContext().getRealModuleName(parentName)) { if (!UnderlyingModule && allowLoading) { auto importer = getContext().getClangModuleLoader(); - assert(importer && "no way to import shadowed module"); + if (!importer) + return nullptr; UnderlyingModule = importer->loadModule(SourceLoc(), name.getTopLevelPath()); }