From c59b1cae499639fb0f3e9fff525bc74c1e12523f 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. llvm-svn: 192103 --- llvm/lib/Support/Windows/Process.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Support/Windows/Process.inc b/llvm/lib/Support/Windows/Process.inc index 4d801492e830..50a204fe5fae 100644 --- a/llvm/lib/Support/Windows/Process.inc +++ b/llvm/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;