Bunch of cleanups for warnings found by the llvm static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165808 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/CommandObjectScript.cpp b/source/Interpreter/CommandObjectScript.cpp
index 76bfe6e..ce097b7 100644
--- a/source/Interpreter/CommandObjectScript.cpp
+++ b/source/Interpreter/CommandObjectScript.cpp
@@ -55,6 +55,7 @@
{
result.AppendError("no script interpreter");
result.SetStatus (eReturnStatusFailed);
+ return false;
}
DataVisualization::ForceUpdate(); // script might change Python code we use for formatting.. make sure we keep up to date with it
diff --git a/source/Interpreter/Options.cpp b/source/Interpreter/Options.cpp
index daf631f..484e778 100644
--- a/source/Interpreter/Options.cpp
+++ b/source/Interpreter/Options.cpp
@@ -439,7 +439,8 @@
// Different option sets may require different args.
StreamString args_str;
- cmd->GetFormattedCommandArguments(args_str, opt_set_mask);
+ if (cmd)
+ cmd->GetFormattedCommandArguments(args_str, opt_set_mask);
// First go through and print all options that take no arguments as
// a single string. If a command has "-a" "-b" and "-c", this will show
@@ -569,7 +570,8 @@
}
}
- if (cmd->WantsRawCommandString() &&
+ if (cmd &&
+ cmd->WantsRawCommandString() &&
arguments_str.GetSize() > 0)
{
strm.PutChar('\n');