File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,6 @@ ModuleFile::loadDependenciesForFileContext(const FileUnit *file,
152152 SourceLoc diagLoc,
153153 bool forTestable) {
154154 ASTContext &ctx = getContext ();
155- auto clangImporter = static_cast <ClangImporter *>(ctx.getClangModuleLoader ());
156155 ModuleDecl *M = file->getParentModule ();
157156
158157 bool missingDependency = false ;
@@ -163,6 +162,11 @@ ModuleFile::loadDependenciesForFileContext(const FileUnit *file,
163162 assert (!dependency.isLoaded () && " already loaded?" );
164163
165164 if (dependency.isHeader ()) {
165+ auto clangImporter =
166+ static_cast <ClangImporter *>(ctx.getClangModuleLoader ());
167+ if (!clangImporter)
168+ return Status::FailedToLoadBridgingHeader;
169+
166170 // The path may be empty if the file being loaded is a partial AST,
167171 // and the current compiler invocation is a merge-modules step.
168172 if (!dependency.Core .RawPath .empty ()) {
You can’t perform that action at this time.
0 commit comments