mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
Windows/Process.inc: Fix for +Asserts. &Buf[0] is not guaranteed if size is zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192103 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cfa7d81a45
commit
e11f460ee0
@ -161,7 +161,7 @@ Optional<std::string> Process::GetEnv(StringRef Name) {
|
|||||||
SmallVector<wchar_t, MAX_PATH> Buf;
|
SmallVector<wchar_t, MAX_PATH> Buf;
|
||||||
size_t Size = MAX_PATH;
|
size_t Size = MAX_PATH;
|
||||||
do {
|
do {
|
||||||
Buf.reserve(Size);
|
Buf.resize(Size);
|
||||||
Size = GetEnvironmentVariableW(&NameUTF16[0], &Buf[0], Buf.capacity());
|
Size = GetEnvironmentVariableW(&NameUTF16[0], &Buf[0], Buf.capacity());
|
||||||
if (Size == 0)
|
if (Size == 0)
|
||||||
return None;
|
return None;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user