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
This commit is contained in:
Owen Anderson 2008-08-21 22:39:33 +00:00
parent ae0218c914
commit fd2a05332a

View File

@ -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();
}