Skip to content

Commit d781e3c

Browse files
Merge pull request #9302 from adrian-prantl/log-instead-of-assert
Emit a types log instead of an lldbassert() in SwiftDWARFImporterDele…
2 parents 8c2a65f + 0099133 commit d781e3c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,14 @@ 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;
183179
LLDB_LOG(GetLog(LLDBLog::Types), "{0}::lookupValue(\"{1}\")", m_description,
184180
name.str());
181+
if (!name.size() || name[0] < 0) {
182+
LLDB_LOG(GetLog(LLDBLog::Types),
183+
"SwiftDWARFImporterDelegate was asked to look up a type with a "
184+
"non-ASCII or empty type name");
185+
return;
186+
}
185187
auto clang_importer = m_swift_ast_ctx.GetClangImporter();
186188
if (!clang_importer) {
187189
LLDB_LOG(GetLog(LLDBLog::Types), "no clangimporter");

0 commit comments

Comments
 (0)