[Lldb-commits] [lldb] [lldb][windows] refactor FileAction (PR #179274)

Dmitry Vasilyev via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 3 04:58:10 PST 2026


================
@@ -242,8 +242,10 @@ llvm::ErrorOr<std::vector<HANDLE>> ProcessLauncherWindows::GetInheritedHandles(
   for (size_t i = 0; i < launch_info.GetNumFileActions(); ++i) {
     const FileAction *act = launch_info.GetFileActionAtIndex(i);
     if (act->GetAction() == FileAction::eFileActionDuplicate &&
-        act->GetFD() == act->GetActionArgument())
-      inherited_handles.push_back(reinterpret_cast<HANDLE>(act->GetFD()));
+        act->GetFD() == act->GetActionArgument() &&
+        std::find(inherited_handles.begin(), inherited_handles.end(),
+                  act->GetHandle()) != inherited_handles.end())
----------------
slydiman wrote:

Nice catch. It seems the condition must be  `== inherited_handles.end()`. inherited_handles must be a set, no duplicates.

https://github.com/llvm/llvm-project/pull/179274


More information about the lldb-commits mailing list