From e11f460ee03dc80c977de97bdaabc6cc5e692fd9 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 7 Oct 2013 15:33:30 +0000 Subject: [PATCH] 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 --- lib/Support/Windows/Process.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Support/Windows/Process.inc b/lib/Support/Windows/Process.inc index 4d801492e83..50a204fe5fa 100644 --- a/lib/Support/Windows/Process.inc +++ b/lib/Support/Windows/Process.inc @@ -161,7 +161,7 @@ Optional Process::GetEnv(StringRef Name) { SmallVector 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; -- 2.34.1