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
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
index d6a1f54..22e12e9 100644
--- a/lib/Support/MemoryBuffer.cpp
+++ b/lib/Support/MemoryBuffer.cpp
@@ -292,5 +292,6 @@
return 0;
}
- return getMemBufferCopy(StringRef(&FileData[0], FileData.size()), "<stdin>");
+ FileData.push_back(0); // &FileData[Size] is invalid. So is &*FileData.end().
+ return getMemBufferCopy(StringRef(&FileData[0],FileData.size()-1), "<stdin>");
}