1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Fix a bug in raw_ostream::write(char) introduced by the change to

allow underlying stream classes to decline buffering. After
calling SetBuffered(), re-check whether the stream is Unbuffered
in order to handle the case where the underlying stream has
declined buffering.

llvm-svn: 79362
This commit is contained in:
Dan Gohman 2009-08-18 20:09:59 +00:00
parent 5aa51a83c7
commit 1d84247c99

View File

@ -187,10 +187,17 @@ raw_ostream &raw_ostream::write(unsigned char C) {
return *this;
}
if (!OutBufStart)
SetBuffered();
else
if (OutBufStart)
flush_nonempty();
else {
SetBuffered();
// It's possible for the underlying stream to decline
// buffering, so check this condition again.
if (Unbuffered) {
write_impl(reinterpret_cast<char*>(&C), 1);
return *this;
}
}
}
*OutBufCur++ = C;