summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-01-08 02:36:54 +0000
committerEnrico Granata <egranata@apple.com>2013-01-08 02:36:54 +0000
commitd994540259637dc11fb8436e2e572920c1afc488 (patch)
tree3d0bcd1c6fb08b31737c4dc43aa07bdc9dbf62f3 /lldb/source
parent8a9980b4d85fc0f9472cb3e779b37abf5935beaa (diff)
downloadbcm5719-llvm-d994540259637dc11fb8436e2e572920c1afc488.tar.gz
bcm5719-llvm-d994540259637dc11fb8436e2e572920c1afc488.zip
<rdar://problem/12968925>
Ensuring that the Module's FileSpec is not NULL before attempting to deref it for loading the python scripting resource llvm-svn: 171838
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index f2f7a91559d..c0f12cd7b6c 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -54,6 +54,13 @@ FileSpec
PlatformDarwin::LocateExecutableScriptingResource (const ModuleSpec &module_spec)
{
const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
+ // APIs such as NSLinkModule() allow us to attach a library without a filename
+ // make sure we do not crash under those circumstances
+ if (!exec_fspec)
+ return FileSpec();
+
+ // if the arch and uuid are ever used for anything other than display purposes
+ // make sure they are not NULL before proceeding
const ArchSpec *arch = module_spec.GetArchitecturePtr();
const UUID *uuid = module_spec.GetUUIDPtr();
OpenPOWER on IntegriCloud