From: NAKAMURA Takumi Date: Mon, 7 Oct 2013 15:33:30 +0000 (+0000) Subject: Windows/Process.inc: Fix for +Asserts. &Buf[0] is not guaranteed if size is zero. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=e11f460ee03dc80c977de97bdaabc6cc5e692fd9;p=oota-llvm.git 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 --- 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;