From 6f43d9df61b78358e238c08f6e1e4c2215bad131 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Tue, 15 Nov 2016 10:58:16 +0000 Subject: [PATCH] Fix uninitialized members. Summary: Fix uninitialized members. Reviewers: jingham Subscribers: jingham, lldb-commits Differential Revision: https://reviews.llvm.org/D26528 llvm-svn: 286947 --- lldb/include/lldb/Host/FileSpec.h | 6 +++--- lldb/source/Host/common/FileSpec.cpp | 6 ++---- lldb/source/Target/Process.cpp | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lldb/include/lldb/Host/FileSpec.h b/lldb/include/lldb/Host/FileSpec.h index 3a4772a..264518b 100644 --- a/lldb/include/lldb/Host/FileSpec.h +++ b/lldb/include/lldb/Host/FileSpec.h @@ -745,9 +745,9 @@ protected: //------------------------------------------------------------------ // Member variables //------------------------------------------------------------------ - ConstString m_directory; ///< The uniqued directory path - ConstString m_filename; ///< The uniqued filename path - mutable bool m_is_resolved; ///< True if this path has been resolved. + ConstString m_directory; ///< The uniqued directory path + ConstString m_filename; ///< The uniqued filename path + mutable bool m_is_resolved = false; ///< True if this path has been resolved. PathSyntax m_syntax; ///< The syntax that this path uses (e.g. Windows / Posix) }; diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index c8972ee..d958d8c 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -277,16 +277,14 @@ void FileSpec::Resolve(llvm::SmallVectorImpl &path) { } } -FileSpec::FileSpec() - : m_directory(), m_filename(), m_syntax(FileSystem::GetNativePathSyntax()) { -} +FileSpec::FileSpec() : m_syntax(FileSystem::GetNativePathSyntax()) {} //------------------------------------------------------------------ // Default constructor that can take an optional full path to a // file on disk. //------------------------------------------------------------------ FileSpec::FileSpec(llvm::StringRef path, bool resolve_path, PathSyntax syntax) - : m_directory(), m_filename(), m_is_resolved(false), m_syntax(syntax) { + : m_syntax(syntax) { SetFile(path, resolve_path, syntax); } diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index ffaa19d..86cd6e8 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -4577,8 +4577,7 @@ public: IOHandlerProcessSTDIO(Process *process, int write_fd) : IOHandler(process->GetTarget().GetDebugger(), IOHandler::Type::ProcessIO), - m_process(process), m_read_file(), m_write_file(write_fd, false), - m_pipe() { + m_process(process), m_write_file(write_fd, false) { m_pipe.CreateNew(false); m_read_file.SetDescriptor(GetInputFD(), false); } @@ -4710,7 +4709,7 @@ protected: File m_write_file; // Write to this file (usually the master pty for getting // io to debuggee) Pipe m_pipe; - std::atomic m_is_running; + std::atomic m_is_running{false}; }; void Process::SetSTDIOFileDescriptor(int fd) { -- 2.7.4