From 80fcdd429f33b2058dc94e8891ddb54ac0e1628e Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Sat, 3 Nov 2012 00:09:46 +0000 Subject: [PATCH] Caught two cases where we were passing a Stream* without checking for NULL llvm-svn: 167342 --- lldb/source/Core/ConstString.cpp | 9 ++++++--- lldb/source/Host/common/FileSpec.cpp | 11 +++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lldb/source/Core/ConstString.cpp b/lldb/source/Core/ConstString.cpp index 572b481..7dfc553 100644 --- a/lldb/source/Core/ConstString.cpp +++ b/lldb/source/Core/ConstString.cpp @@ -279,9 +279,12 @@ ConstString::Compare (const ConstString& lhs, const ConstString& rhs) 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 diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index d356ff6..5109695 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -524,10 +524,13 @@ FileSpec::Equal (const FileSpec& a, const FileSpec& b, bool full) 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); + } } //------------------------------------------------------------------ -- 2.7.4