diff options
| author | Jorge Gorbe Moya <jgorbe@google.com> | 2019-05-22 23:37:48 +0000 |
|---|---|---|
| committer | Jorge Gorbe Moya <jgorbe@google.com> | 2019-05-22 23:37:48 +0000 |
| commit | 33dbab82715c1d5fd8f3d521eb0b131cb742d2b2 (patch) | |
| tree | e47a0a4e9b9b797402d120c8df5f3c61b7ea47c7 | |
| parent | 2956127f5b4e6bc6da77f47d86ed559c76c0c9a4 (diff) | |
| download | bcm5719-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.cpp | 2 |
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); |

