A defensive check in ProcessLauncherWindows meant that we would never
attempt to launch a process with a completely empty environment -- the
host environment would be used instead. Insted, I make function add an
extra null wchar_t at the end of an empty environment. The documentation
on this is a bit fuzzy, but it seems to be what is needed to make
windows accept these kinds of environments.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
The code is correct, so I'm approving, but I suggest a couple fixes to the comments before committing..
lldb/source/Host/windows/ProcessLauncherWindows.cpp | ||
---|---|---|
27 | You have an extra "list of" between null-terminated and "strings". And I think we should point out that it's UTF-16 encoded, so maybe: // The buffer is a list of null-terminated UTF-16 strings, followed by an // extra L'\0' (two bytes of 0). An empty environment must have one // empty string, followed by an extra L'\0'. | |
40 | "... an extra two bytes ..." | |
42 | There would be no harm in always adding the extra terminator. |
lldb/source/Host/windows/ProcessLauncherWindows.cpp | ||
---|---|---|
42 | Yeah, I wondered myself what would be less confusing... inserting a seemingly needless terminator, or cluttering the code with an extra if... |
You have an extra "list of" between null-terminated and "strings". And I think we should point out that it's UTF-16 encoded, so maybe: