Fix a crash on some platforms where a dSYM for a system library lists a DW_AT_mips_linkage_name for

a non-mangled function - we pass the non mangled string down through abi::__cxa_demangle and it
crashes.  Usually passing non mangled strings to abi::__cxa_demangle works out fine but not
always, apparently.

llvm-svn: 121834
This commit is contained in:
Jason Molenda 2010-12-15 04:20:25 +00:00
parent 357d0f3caf
commit b690fbbaec
1 changed files with 2 additions and 1 deletions

View File

@ -143,7 +143,8 @@ Mangled::GetDemangledName () const
// We already know mangled is valid from the above check,
// lets just make sure it isn't empty...
const char * mangled = m_mangled.AsCString();
if (mangled[0])
// Don't bother running anything that doesn't start with _Z through the demangler
if (mangled[0] != '\0' && mangled[0] == '_' && mangled[1] == 'Z')
{
// Since demangling can be a costly, and since all names that go
// into a ConstString (like our m_mangled and m_demangled members)