aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-08-21 22:39:33 +0000
committerOwen Anderson <resistor@mac.com>2008-08-21 22:39:33 +0000
commitfd2a05332a11399e08fcd8a1e952e1fc959fac5c (patch)
treeb4ce01ceb72ece95369256e9e0a6504b3599331f /lib
parentae0218c914331510e2d7e3cda4d33d0457e2552d (diff)
downloadexternal_llvm-fd2a05332a11399e08fcd8a1e952e1fc959fac5c.zip
external_llvm-fd2a05332a11399e08fcd8a1e952e1fc959fac5c.tar.gz
external_llvm-fd2a05332a11399e08fcd8a1e952e1fc959fac5c.tar.bz2
Fix write() when the string being written is larger than the buffer. This broke various ObjC testcases
with very long symbol names. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55148 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/raw_ostream.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index b1209a2..a5cf629 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/lib/Support/raw_ostream.cpp
@@ -116,6 +116,7 @@ raw_ostream &raw_ostream::write(const char *Ptr, unsigned Size) {
assert(OutBufCur == OutBufStart);
memcpy(OutBufStart, Ptr, NumToEmit);
Ptr += NumToEmit;
+ Size -= NumToEmit;
OutBufCur = OutBufStart + NumToEmit;
flush_impl();
}