diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-06-25 12:51:01 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-06-25 12:51:01 +0000 |
commit | 7262c19c41fd291af7a23a6bb8558314ef8425dd (patch) | |
tree | 62b118e157cae2001baf5979231f57f026e6243f /lib/Support/MemoryBuffer.cpp | |
parent | d4d1f85aa751cadf69768746afd2c6c43c116ac2 (diff) |
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
Diffstat (limited to 'lib/Support/MemoryBuffer.cpp')
-rw-r--r-- | lib/Support/MemoryBuffer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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()), "<stdin>"); + FileData.push_back(0); // &FileData[Size] is invalid. So is &*FileData.end(). + return getMemBufferCopy(StringRef(&FileData[0],FileData.size()-1), "<stdin>"); } |