diff options
author | Jim Ingham <jingham@apple.com> | 2012-10-12 17:34:26 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2012-10-12 17:34:26 +0000 |
commit | 28eb57114d05dd100d9b4a56e0a00be85cd09e3b (patch) | |
tree | 61467023c9112981c8ff375d429b244c7b95c475 /lldb/source/Commands/CommandObjectTarget.cpp | |
parent | e87f41f43e5d5dafa5794a1f78c849a774ea989a (diff) | |
download | bcm5719-llvm-28eb57114d05dd100d9b4a56e0a00be85cd09e3b.tar.gz bcm5719-llvm-28eb57114d05dd100d9b4a56e0a00be85cd09e3b.zip |
Bunch of cleanups for warnings found by the llvm static analyzer.
llvm-svn: 165808
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 82f7cf3f4f9..6f77106a6f7 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -1227,7 +1227,7 @@ DumpModuleArchitecture (Stream &strm, Module *module, bool full_triple, uint32_t static void DumpModuleUUID (Stream &strm, Module *module) { - if (module->GetUUID().IsValid()) + if (module && module->GetUUID().IsValid()) module->GetUUID().Dump (&strm); else strm.PutCString(" "); @@ -2720,8 +2720,14 @@ protected: } else { - module->GetFileSpec().GetPath (path, sizeof(path)); - result.AppendErrorWithFormat ("invalid module '%s'.\n", path); + FileSpec *module_spec_file = module_spec.GetFileSpecPtr(); + if (module_spec_file) + { + module_spec_file->GetPath (path, sizeof(path)); + result.AppendErrorWithFormat ("invalid module '%s'.\n", path); + } + else + result.AppendError ("no module spec"); result.SetStatus (eReturnStatusFailed); } } @@ -3033,6 +3039,12 @@ protected: PrintModule (Target *target, Module *module, uint32_t idx, int indent, Stream &strm) { + if (module == NULL) + { + strm.PutCString("Null module"); + return; + } + bool dump_object_name = false; if (m_options.m_format_array.empty()) { |