[Lldb-commits] [lldb] r237484 - Don't crash if a function has no name by calling 'strcmp(name, "main")'.

Greg Clayton gclayton at apple.com
Fri May 15 15:20:29 PDT 2015


Author: gclayton
Date: Fri May 15 17:20:29 2015
New Revision: 237484

URL: http://llvm.org/viewvc/llvm-project?rev=237484&view=rev
Log:
Don't crash if a function has no name by calling 'strcmp(name, "main")'.

<rdar://problem/20925061>


Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=237484&r1=237483&r2=237484&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri May 15 17:20:29 2015
@@ -1103,7 +1103,7 @@ SymbolFileDWARF::ParseCompileUnitFunctio
                 func_name.SetValue(ConstString(mangled), true);
             else if (die->GetParent()->Tag() == DW_TAG_compile_unit &&
                      LanguageRuntime::LanguageIsCPlusPlus(dwarf_cu->GetLanguageType()) &&
-                     strcmp(name, "main") != 0)
+                     name && strcmp(name, "main") != 0)
             {
                 // If the mangled name is not present in the DWARF, generate the demangled name
                 // using the decl context. We skip if the function is "main" as its name is





More information about the lldb-commits mailing list