From 645a3d6995c222b43cf2fc63331a7779de2c96c2 Mon Sep 17 00:00:00 2001 From: Alex Denisov Date: Tue, 10 Oct 2023 15:50:36 +0200 Subject: [PATCH] Swift: skip unavailable decl members --- swift/extractor/translators/DeclTranslator.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/swift/extractor/translators/DeclTranslator.cpp b/swift/extractor/translators/DeclTranslator.cpp index d7ec3c6cd1bf8..a74dc61942b6c 100644 --- a/swift/extractor/translators/DeclTranslator.cpp +++ b/swift/extractor/translators/DeclTranslator.cpp @@ -279,7 +279,12 @@ void DeclTranslator::fillTypeDecl(const swift::TypeDecl& decl, codeql::TypeDecl& void DeclTranslator::fillIterableDeclContext(const swift::IterableDeclContext& decl, codeql::Decl& entry) { - entry.members = dispatcher.fetchRepeatedLabels(decl.getAllMembers()); + for (auto member : decl.getMembers()) { + if (swift::AvailableAttr::isUnavailable(member)) { + continue; + } + entry.members.emplace_back(dispatcher.fetchLabel(member)); + } } void DeclTranslator::fillVarDecl(const swift::VarDecl& decl, codeql::VarDecl& entry) {