Skip to content

Commit 260125e

Browse files
[ModuleTrace] Early exit if a Clang module imports itself.
Fixes rdar://67435472.
1 parent 32e0305 commit 260125e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,9 @@ void ABIDependencyEvaluator::computeABIDependenciesForClangModule(
588588
}
589589
if (import->isNonSwiftModule()
590590
&& module->getTopLevelModule() == import->getTopLevelModule()
591-
&& !import->findUnderlyingClangModule()
592-
->isSubModuleOf(module->findUnderlyingClangModule())) {
591+
&& (module == import
592+
|| !import->findUnderlyingClangModule()
593+
->isSubModuleOf(module->findUnderlyingClangModule()))) {
593594
continue;
594595
}
595596
computeABIDependenciesForModule(import);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Check that this doesn't crash due to a self-cycle. rdar://67435472
2-
// RUN: not --crash %target-swift-frontend %s -emit-module -o /dev/null -emit-loaded-module-trace-path /dev/null -I %S/Inputs/imported_modules/SelfImport
2+
// RUN: %target-swift-frontend %s -emit-module -o /dev/null -emit-loaded-module-trace-path /dev/null -I %S/Inputs/imported_modules/SelfImport
33

44
import Outer

0 commit comments

Comments
 (0)