Skip to content

Commit c4654ad

Browse files
committed
[lldb] Prevent GetDisplayDemangledName from returning empty string
1 parent 74f34b6 commit c4654ad

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lldb/include/lldb/Target/Language.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class Language : public PluginInterface {
270270
return mangled.GetMangledName();
271271
}
272272

273-
virtual ConstString GetDisplayDemangledName(Mangled mangled) const {
273+
virtual ConstString GetDisplayDemangledName(const Mangled &mangled) const {
274274
return mangled.GetDemangledName();
275275
}
276276

lldb/source/Core/Mangled.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ ConstString Mangled::GetDisplayDemangledName(
338338
#endif // LLDB_ENABLE_SWIFT
339339
// END SWIFT
340340
if (Language *lang = Language::FindPlugin(GuessLanguage()))
341-
return lang->GetDisplayDemangledName(*this);
341+
if (ConstString display_name = lang->GetDisplayDemangledName(*this))
342+
return display_name;
342343
return GetDemangledName();
343344
}
344345

0 commit comments

Comments
 (0)