llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: None (lb90)

<details>
<summary>Changes</summary>

Fixes https://github.com/msys2/MINGW-packages/issues/26030

---
Full diff: https://github.com/llvm/llvm-project/pull/165281.diff


1 Files Affected:

- (modified) lldb/source/Host/windows/ProcessLauncherWindows.cpp (+6) 


``````````diff
diff --git a/lldb/source/Host/windows/ProcessLauncherWindows.cpp 
b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
index f5adadaf061bf..ab151f1a9a0ac 100644
--- a/lldb/source/Host/windows/ProcessLauncherWindows.cpp
+++ b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
@@ -15,6 +15,7 @@
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/Program.h"
 
+#include <algorithm>
 #include <string>
 #include <vector>
 
@@ -122,6 +123,11 @@ ProcessLauncherWindows::LaunchProcess(const 
ProcessLaunchInfo &launch_info,
         act->GetFD() == act->GetActionArgument())
       inherited_handles.push_back(reinterpret_cast<HANDLE>(act->GetFD()));
   }
+  // Remove duplicate HANDLEs
+  std::sort(inherited_handles.begin(), inherited_handles.end());
+  inherited_handles.erase(
+      std::unique(inherited_handles.begin(), inherited_handles.end()),
+      inherited_handles.end());
   if (!inherited_handles.empty()) {
     if (!UpdateProcThreadAttribute(
             startupinfoex.lpAttributeList, /*dwFlags=*/0,

``````````

</details>


https://github.com/llvm/llvm-project/pull/165281
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to