Fix write() when the string being written is larger than the buffer. This broke various ObjC testcases

with very long symbol names.

llvm-svn: 55148
This commit is contained in:
Owen Anderson 2008-08-21 22:39:33 +00:00
parent 2fd7dbaf1d
commit 3ad8ac90b6
1 changed files with 1 additions and 0 deletions

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