Fixed a couple of places where we were getting the module from a
section and using it w/o checking that it was valid. This can
cause crashes - usually when tearing down a target.
llvm-svn: 259237
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp
index 83100de..a12d651 100644
--- a/lldb/source/Core/Address.cpp
+++ b/lldb/source/Core/Address.cpp
@@ -442,7 +442,11 @@
case DumpStyleModuleWithFileAddress:
if (section_sp)
{
- s->Printf("%s[", section_sp->GetModule()->GetFileSpec().GetFilename().AsCString("<Unknown>"));
+ ModuleSP module_sp = section_sp->GetModule();
+ if (module_sp)
+ s->Printf("%s[", module_sp->GetFileSpec().GetFilename().AsCString("<Unknown>"));
+ else
+ s->Printf("%s[","<Unknown>");
}
// Fall through
case DumpStyleFileAddress: