about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-06-24 17:37:29 +0000
committerbors <bors@rust-lang.org>2021-06-24 17:37:29 +0000
commitcbeda5cbeb9a3b92a1df997869a49d9584ca10c2 (patch)
tree4468f6468cc7227782bf6820c13c1241e442a08c /compiler/rustc_codegen_llvm/src
parentd95745e5fa39680d97a52d0e07ed7842b163bacc (diff)
parent16145a99528c862cfaca87e836fdd844ba155567 (diff)
downloadrust-cbeda5cbeb9a3b92a1df997869a49d9584ca10c2.tar.gz
rust-cbeda5cbeb9a3b92a1df997869a49d9584ca10c2.zip
Auto merge of #86467 - ChrisDenton:win-env-clear, r=JohnTitor
Windows: Fix `Command::env_clear` so it works if no variables are set

Previously, it would error unless at least one new environment variable was added. The missing null presumably meant that Windows was reading random memory in that case.

See: [CreateProcessW](https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw) (scroll down to `lpEnvironment`). Essentially the environment block is a null terminated list of null terminated strings and an empty list is `\0\0` and not `\0`.

EDIT: Oh, [CreateEnvironmentBlock](https://docs.microsoft.com/en-gb/windows/win32/api/userenv/nf-userenv-createenvironmentblock) states this much more explicitly.

Fixes #31259
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions