[Lldb-commits] [lldb] [lldb][windows] fix a use before allocation crash (PR #170530)
Charles Zablit via lldb-commits
lldb-commits at lists.llvm.org
Wed Dec 3 10:57:34 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(
----------------
charles-zablit wrote:
When https://github.com/llvm/llvm-project/pull/168729 eventually gets merged, `inherited_handles` will be assigned to in an `if` statement, and is later used outside of the scope of that `if` statement. I decided to just declare it at the top of the method as it was the case before https://github.com/llvm/llvm-project/pull/170301 was merged: https://github.com/llvm/llvm-project/pull/170301/files#diff-e88204c0b3183c22166588028caaa5bc946c63fc9e90af696f60603325b1d08dL116
Outside of the context of https://github.com/llvm/llvm-project/pull/168729, it does not make much sense, I reverted that change and moved it to line 134.
https://github.com/llvm/llvm-project/pull/170530
More information about the lldb-commits
mailing list