From 7262c19c41fd291af7a23a6bb8558314ef8425dd Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 25 Jun 2010 12:51:01 +0000 Subject: Bring back the empty vector workaround I removed in r106839. Looks like MSVC needs it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106841 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/MemoryBuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Support/MemoryBuffer.cpp') diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index d6a1f54877..22e12e9d34 100644 --- a/lib/Support/MemoryBuffer.cpp +++ b/lib/Support/MemoryBuffer.cpp @@ -292,5 +292,6 @@ MemoryBuffer *MemoryBuffer::getSTDIN(std::string *ErrStr) { return 0; } - return getMemBufferCopy(StringRef(&FileData[0], FileData.size()), ""); + FileData.push_back(0); // &FileData[Size] is invalid. So is &*FileData.end(). + return getMemBufferCopy(StringRef(&FileData[0],FileData.size()-1), ""); } -- cgit v1.2.3-18-g5258