Skip to content

Commit 880b866

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 07ade1d commit 880b866

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
@@ -738,9 +738,10 @@ void swift::serialization::diagnoseSerializedASTLoadFailure(
738738
std::copy_if(
739739
loadedModuleFile->getDependencies().begin(),
740740
loadedModuleFile->getDependencies().end(), std::back_inserter(missing),
741-
[&duplicates](const ModuleFile::Dependency &dependency) -> bool {
741+
[&duplicates, &Ctx](const ModuleFile::Dependency &dependency) -> bool {
742742
if (dependency.isLoaded() || dependency.isHeader() ||
743-
dependency.isImplementationOnly()) {
743+
(dependency.isImplementationOnly() &&
744+
Ctx.LangOpts.DebuggerSupport)) {
744745
return false;
745746
}
746747
return duplicates.insert(dependency.RawPath).second;

0 commit comments

Comments
 (0)