Skip to content

Commit 276fec3

Browse files
committed
Swift: consider lazy declaration emitted if the process lost in the race
1 parent ded0e57 commit 276fec3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

swift/extractor/SwiftExtractor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ static std::unordered_set<swift::ModuleDecl*> extractDeclarations(
123123
auto trap = createTargetTrapDomain(state, filename, trapType);
124124
if (!trap) {
125125
// another process arrived first, nothing to do for us
126+
if (lazyDeclaration) {
127+
state.emittedDeclarations.insert(lazyDeclaration);
128+
}
126129
return {};
127130
}
128131

@@ -242,7 +245,7 @@ void codeql::extractExtractLazyDeclarations(SwiftExtractorState& state,
242245
extractLazy(state, compiler);
243246
}
244247
if (iteration >= upperBound) {
245-
std::cerr << "Swift extractor reach upper bound while extracting lazy declarations\n";
248+
std::cerr << "Swift extractor reached upper bound while extracting lazy declarations\n";
246249
abort();
247250
}
248251
}

0 commit comments

Comments
 (0)