1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/unittests/Support
Rafael Espindola 644c5436f5 Fix crash when multiple raw_fd_ostreams to stdout are created.
If raw_fd_ostream is constructed with the path of "-", it claims
ownership of the stdout file descriptor. This means that it closes
stdout when it is destroyed. If there are multiple users of
raw_fd_ostream wrapped around stdout, then a crash can occur because
of operations on a closed stream.

An example of this would be running something like "clang -S -o - -MD
-MF - test.cpp". Alternatively, using outs() (which creates a local
version of raw_fd_stream to stdout) anywhere combined with such a
stream usage would cause the crash.

The fix duplicates the stdout file descriptor when used within
raw_fd_ostream, so that only that particular descriptor is closed when
the stream is destroyed.

Patch by James Henderson!

llvm-svn: 297624
2017-03-13 14:45:06 +00:00
..
AlignOfTest.cpp
AllocatorTest.cpp [unittest] Explicitly specify alignment when using BumpPtrAllocator. 2017-03-11 01:24:56 +00:00
ARMAttributeParser.cpp
ArrayRecyclerTest.cpp
BinaryStreamTest.cpp [unittest] Explicitly specify alignment when using BumpPtrAllocator. 2017-03-11 01:24:56 +00:00
BlockFrequencyTest.cpp
BranchProbabilityTest.cpp
Casting.cpp
Chrono.cpp [Support] Add FormatVariadic support for chrono types 2017-02-07 18:11:33 +00:00
CMakeLists.txt [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
CommandLineTest.cpp
CompressionTest.cpp
ConvertUTFTest.cpp
DataExtractorTest.cpp
DebugTest.cpp
DwarfTest.cpp
EndianStreamTest.cpp
EndianTest.cpp
ErrorOrTest.cpp
ErrorTest.cpp [Support][Error] Add a 'cantFail' utility function for known-safe calls to 2017-02-27 21:09:47 +00:00
FileOutputBufferTest.cpp
formatted_raw_ostream_test.cpp
FormatVariadicTest.cpp [Support] Add formatv support for StringLiteral 2017-02-14 16:35:56 +00:00
GlobPatternTest.cpp
Host.cpp [Support] Simplify triple check in Host CPU test. NFC. 2017-02-04 00:46:59 +00:00
LEB128Test.cpp [Support] Extend SLEB128 encoding support. 2017-02-10 00:02:58 +00:00
LineIteratorTest.cpp
LockFileManagerTest.cpp
ManagedStatic.cpp
MathExtrasTest.cpp
MD5Test.cpp
MemoryBufferTest.cpp
MemoryTest.cpp
NativeFormatTests.cpp
Path.cpp Reverting r297617 because it broke some bots: 2017-03-13 12:24:51 +00:00
ProcessTest.cpp
ProgramTest.cpp
raw_ostream_test.cpp Fix crash when multiple raw_fd_ostreams to stdout are created. 2017-03-13 14:45:06 +00:00
raw_pwrite_stream_test.cpp
raw_sha1_ostream_test.cpp
RegexTest.cpp
ReplaceFileTest.cpp
ScaledNumberTest.cpp
SourceMgrTest.cpp
SpecialCaseListTest.cpp
StringPool.cpp
SwapByteOrderTest.cpp
TargetParserTest.cpp [AArch64] Vulcan is now ThunderXT99 2017-03-07 19:42:40 +00:00
TarWriterTest.cpp
Threading.cpp
ThreadLocalTest.cpp
ThreadPool.cpp
TimerTest.cpp
TrailingObjectsTest.cpp Workaround MSVC bug when using TrailingObjects from a template. 2017-02-28 18:05:41 +00:00
TrigramIndexTest.cpp
TypeNameTest.cpp
UnicodeTest.cpp
xxhashTest.cpp
YAMLIOTest.cpp
YAMLParserTest.cpp