Skip to content

Commit 1067054

Browse files
Merge pull request #9296 from adrian-prantl/cherry-pick-next-Guard-DWARFImporter-against-obviously-bad-input
[Cherry-pick into next] Guard DWARFImporter against obviously bad input
2 parents 91e5e83 + cfbe7ac commit 1067054

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ SwiftDWARFImporterDelegate::SwiftDWARFImporterDelegate(SwiftASTContext &ts)
176176
void SwiftDWARFImporterDelegate::lookupValue(
177177
StringRef name, std::optional<swift::ClangTypeKind> kind,
178178
StringRef inModule, llvm::SmallVectorImpl<clang::Decl *> &results) {
179+
bool suspicious = !name.size() || name[0] > 128;
180+
lldbassert(!suspicious && "SwiftDWARFImporterDelegate asked to look up bogus type name");
181+
if (suspicious)
182+
return;
179183
LLDB_LOG(GetLog(LLDBLog::Types), "{0}::lookupValue(\"{1}\")", m_description,
180184
name.str());
181185
auto clang_importer = m_swift_ast_ctx.GetClangImporter();

0 commit comments

Comments
 (0)