[Lldb-commits] [lldb] r167342 - in /lldb/trunk/source: Core/ConstString.cpp Host/common/FileSpec.cpp

Enrico Granata egranata at apple.com
Fri Nov 2 17:09:46 PDT 2012


Author: enrico
Date: Fri Nov  2 19:09:46 2012
New Revision: 167342

URL: http://llvm.org/viewvc/llvm-project?rev=167342&view=rev
Log:
Caught two cases where we were passing a Stream* without checking for NULL

Modified:
    lldb/trunk/source/Core/ConstString.cpp
    lldb/trunk/source/Host/common/FileSpec.cpp

Modified: lldb/trunk/source/Core/ConstString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConstString.cpp?rev=167342&r1=167341&r2=167342&view=diff
==============================================================================
--- lldb/trunk/source/Core/ConstString.cpp (original)
+++ lldb/trunk/source/Core/ConstString.cpp Fri Nov  2 19:09:46 2012
@@ -279,9 +279,12 @@
 void
 ConstString::Dump(Stream *s, const char *fail_value) const
 {
-    const char *cstr = AsCString (fail_value);
-    if (cstr)
-        s->PutCString (cstr);
+    if (s)
+    {
+        const char *cstr = AsCString (fail_value);
+        if (cstr)
+            s->PutCString (cstr);
+    }
 }
 
 void

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=167342&r1=167341&r2=167342&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Fri Nov  2 19:09:46 2012
@@ -524,10 +524,13 @@
 void
 FileSpec::Dump(Stream *s) const
 {
-    m_directory.Dump(s);
-    if (m_directory)
-        s->PutChar('/');
-    m_filename.Dump(s);
+    if (s)
+    {
+        m_directory.Dump(s);
+        if (m_directory)
+            s->PutChar('/');
+        m_filename.Dump(s);
+    }
 }
 
 //------------------------------------------------------------------





More information about the lldb-commits mailing list