[Lldb-commits] [lldb] ad1311e - [lldb][windows] Fix HostProcessWindows::Terminate clobbering error (#199012)
via lldb-commits
lldb-commits at lists.llvm.org
Thu May 21 06:10:57 PDT 2026
Author: Charles Zablit
Date: 2026-05-21T14:10:52+01:00
New Revision: ad1311e967a5a8ea9a68200f766033d3b7a6753e
URL: https://github.com/llvm/llvm-project/commit/ad1311e967a5a8ea9a68200f766033d3b7a6753e
DIFF: https://github.com/llvm/llvm-project/commit/ad1311e967a5a8ea9a68200f766033d3b7a6753e.diff
LOG: [lldb][windows] Fix HostProcessWindows::Terminate clobbering error (#199012)
Added:
Modified:
lldb/source/Host/windows/HostProcessWindows.cpp
Removed:
################################################################################
diff --git a/lldb/source/Host/windows/HostProcessWindows.cpp b/lldb/source/Host/windows/HostProcessWindows.cpp
index 44cb333808773..c137d24560835 100644
--- a/lldb/source/Host/windows/HostProcessWindows.cpp
+++ b/lldb/source/Host/windows/HostProcessWindows.cpp
@@ -38,14 +38,13 @@ HostProcessWindows::~HostProcessWindows() { Close(); }
void HostProcessWindows::SetOwnsHandle(bool owns) { m_owns_handle = owns; }
Status HostProcessWindows::Terminate() {
- Status error;
if (m_process == nullptr)
- error = Status(ERROR_INVALID_HANDLE, lldb::eErrorTypeWin32);
+ return Status(ERROR_INVALID_HANDLE, lldb::eErrorTypeWin32);
if (!::TerminateProcess(m_process, 0))
- error = Status(::GetLastError(), lldb::eErrorTypeWin32);
+ return Status(::GetLastError(), lldb::eErrorTypeWin32);
- return error;
+ return Status();
}
lldb::pid_t HostProcessWindows::GetProcessId() const {
More information about the lldb-commits
mailing list