diff options
author | Owen Anderson <resistor@mac.com> | 2008-08-21 22:39:33 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-08-21 22:39:33 +0000 |
commit | fd2a05332a11399e08fcd8a1e952e1fc959fac5c (patch) | |
tree | b4ce01ceb72ece95369256e9e0a6504b3599331f /lib | |
parent | ae0218c914331510e2d7e3cda4d33d0457e2552d (diff) | |
download | external_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.cpp | 1 |
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(); } |