[Lldb-commits] [lldb] [lldb][windows] fix a use before allocation crash (PR #170530)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 3 10:48:01 PST 2025


================
@@ -133,6 +125,14 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info,
   auto delete_attributelist = llvm::make_scope_exit(
       [&] { DeleteProcThreadAttributeList(startupinfoex.lpAttributeList); });
 
+  auto inherited_handles_or_err = GetInheritedHandles(
+      launch_info, startupinfoex, stdout_handle, stderr_handle, stdin_handle);
+  if (!inherited_handles_or_err) {
+    error = Status(inherited_handles_or_err.getError());
+    return HostProcess();
+  }
+  inherited_handles = *inherited_handles_or_err;
----------------
JDevlieghere wrote:

```suggestion
  std::vector<HANDLE> inherited_handles; = *inherited_handles_or_err;
```

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


More information about the lldb-commits mailing list