summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBCommandInterpreter.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-12-19 21:16:29 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-12-19 21:16:29 +0000
commit872e06256626b26bd8b3f22de8b93b6296e91037 (patch)
treeaafb27a980302df04ab8b70507cb77e3e61ce982 /lldb/source/API/SBCommandInterpreter.cpp
parent2415357a05b891b3aab8e4fab4d413a88f17fda9 (diff)
downloadbcm5719-llvm-872e06256626b26bd8b3f22de8b93b6296e91037.tar.gz
bcm5719-llvm-872e06256626b26bd8b3f22de8b93b6296e91037.zip
Work in progress for:
rdar://problem/10577182 Audit lldb API impl for places where we need to perform a NULL check Add NULL checks for SBCommandInterpreter APIs. llvm-svn: 146909
Diffstat (limited to 'lldb/source/API/SBCommandInterpreter.cpp')
-rw-r--r--lldb/source/API/SBCommandInterpreter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp
index fe514cbbc11..03f33c69db0 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -65,7 +65,7 @@ SBCommandInterpreter::IsValid() const
bool
SBCommandInterpreter::CommandExists (const char *cmd)
{
- if (m_opaque_ptr)
+ if (cmd && m_opaque_ptr)
return m_opaque_ptr->CommandExists (cmd);
return false;
}
@@ -73,7 +73,7 @@ SBCommandInterpreter::CommandExists (const char *cmd)
bool
SBCommandInterpreter::AliasExists (const char *cmd)
{
- if (m_opaque_ptr)
+ if (cmd && m_opaque_ptr)
return m_opaque_ptr->AliasExists (cmd);
return false;
}
@@ -88,7 +88,7 @@ SBCommandInterpreter::HandleCommand (const char *command_line, SBCommandReturnOb
m_opaque_ptr, command_line, result.get(), add_to_history);
result.Clear();
- if (m_opaque_ptr)
+ if (command_line && m_opaque_ptr)
{
TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
Mutex::Locker api_locker;
@@ -98,7 +98,7 @@ SBCommandInterpreter::HandleCommand (const char *command_line, SBCommandReturnOb
}
else
{
- result->AppendError ("SBCommandInterpreter is not valid");
+ result->AppendError ("SBCommandInterpreter or the command line is not valid");
result->SetStatus (eReturnStatusFailed);
}
OpenPOWER on IntegriCloud