summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Gorbe Moya <jgorbe@google.com>2019-05-22 23:37:48 +0000
committerJorge Gorbe Moya <jgorbe@google.com>2019-05-22 23:37:48 +0000
commit33dbab82715c1d5fd8f3d521eb0b131cb742d2b2 (patch)
treee47a0a4e9b9b797402d120c8df5f3c61b7ea47c7
parent2956127f5b4e6bc6da77f47d86ed559c76c0c9a4 (diff)
downloadbcm5719-llvm-33dbab82715c1d5fd8f3d521eb0b131cb742d2b2.tar.gz
bcm5719-llvm-33dbab82715c1d5fd8f3d521eb0b131cb742d2b2.zip
[lldb] Fix use-of-uninitialized-value in Driver
The driver passes by reference an uninitialized num_errors variable to RunCommandInterpreter. This should be fine, as it's supposed to be an output argument, but the reproducer instrumentation reads it in order to record the value of all the arguments to the function. This change fixes it by initializing num_errors to 0 before calling RunCommandInterpreter. llvm-svn: 361444
-rw-r--r--lldb/tools/driver/Driver.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index 34711d52aa2..53fa1b2e89a 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -610,7 +610,7 @@ int Driver::MainLoop() {
// that run the target won't run in a sensible way.
bool old_async = m_debugger.GetAsync();
m_debugger.SetAsync(false);
- int num_errors;
+ int num_errors = 0;
SBCommandInterpreterRunOptions options;
options.SetStopOnError(true);
OpenPOWER on IntegriCloud