Skip to content

Commit d7024c4

Browse files
committed
TypeSystem: early exit if there are 0 imports
This is a minor u-opt but more importantly the `Progress` type requires that the count of imports being >=1. This avoids an assertion being triggered.
1 parent 952bdd2 commit d7024c4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8340,6 +8340,8 @@ bool SwiftASTContext::GetCompileUnitImportsImpl(
83408340
return true;
83418341

83428342
auto cu_imports = compile_unit->GetImportedModules();
8343+
if (cu_imports.size() == 0)
8344+
return true;
83438345

83448346
Progress progress(
83458347
llvm::formatv("Getting Swift compile unit imports for '{0}'",

0 commit comments

Comments
 (0)