Skip to content

Commit c2f5797

Browse files
committed
[Serialization] Fix crash in reporting missing implementationOnly modules
The diagnostic function crashed as it did not take into account the DebuggerSupport options as the site reporting the missing dependency did. In this context, missing implementation-only imported dependencies are ignored only if DebuggerSupport is set.
1 parent 978ed67 commit c2f5797

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Serialization/SerializedModuleLoader.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,10 @@ void swift::serialization::diagnoseSerializedASTLoadFailure(
708708
std::copy_if(
709709
loadedModuleFile->getDependencies().begin(),
710710
loadedModuleFile->getDependencies().end(), std::back_inserter(missing),
711-
[&duplicates](const ModuleFile::Dependency &dependency) -> bool {
711+
[&duplicates, &Ctx](const ModuleFile::Dependency &dependency) -> bool {
712712
if (dependency.isLoaded() || dependency.isHeader() ||
713-
dependency.isImplementationOnly()) {
713+
(dependency.isImplementationOnly() &&
714+
Ctx.LangOpts.DebuggerSupport)) {
714715
return false;
715716
}
716717
return duplicates.insert(dependency.RawPath).second;

0 commit comments

Comments
 (0)