mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00: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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79362 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
35979c021e
commit
3731604f1f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user