[Lldb-commits] [lldb] r171838 - /lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Enrico Granata egranata at apple.com
Mon Jan 7 18:36:54 PST 2013


Author: enrico
Date: Mon Jan  7 20:36:54 2013
New Revision: 171838

URL: http://llvm.org/viewvc/llvm-project?rev=171838&view=rev
Log:
<rdar://problem/12968925>

Ensuring that the Module's FileSpec is not NULL before attempting to deref it for loading the python scripting resource


Modified:
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=171838&r1=171837&r2=171838&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Mon Jan  7 20:36:54 2013
@@ -54,6 +54,13 @@
 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();
     





More information about the lldb-commits mailing list