aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-10-07 15:33:30 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-10-07 15:33:30 +0000
commite11f460ee03dc80c977de97bdaabc6cc5e692fd9 (patch)
treefdfb71c8a07eaa41e2c270ed930049e975367e01
parentcfa7d81a45648e43031f7f3967e4c324d0e57af5 (diff)
downloadexternal_llvm-e11f460ee03dc80c977de97bdaabc6cc5e692fd9.zip
external_llvm-e11f460ee03dc80c977de97bdaabc6cc5e692fd9.tar.gz
external_llvm-e11f460ee03dc80c977de97bdaabc6cc5e692fd9.tar.bz2
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
-rw-r--r--lib/Support/Windows/Process.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/Windows/Process.inc b/lib/Support/Windows/Process.inc
index 4d80149..50a204f 100644
--- a/lib/Support/Windows/Process.inc
+++ b/lib/Support/Windows/Process.inc
@@ -161,7 +161,7 @@ Optional<std::string> Process::GetEnv(StringRef Name) {
SmallVector<wchar_t, MAX_PATH> Buf;
size_t Size = MAX_PATH;
do {
- Buf.reserve(Size);
+ Buf.resize(Size);
Size = GetEnvironmentVariableW(&NameUTF16[0], &Buf[0], Buf.capacity());
if (Size == 0)
return None;