llvm/test
Rafael Espindola b8ff3dcbf6 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297624 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 14:45:06 +00:00
..
Analysis [ConstantFold] Fix defect in constant folding computation for GEP 2017-03-08 23:01:50 +00:00
Assembler [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
Bindings
Bitcode [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
BugPoint
CodeGen [ARM] GlobalISel: Support SP in regbankselect 2017-03-13 14:28:34 +00:00
DebugInfo [AMDGPU] Split R600/SI getFrameIndexReference and emit stack object offsets for SI 2017-03-10 19:39:07 +00:00
Examples
ExecutionEngine
Feature Disable gvn-hoist (PR32153) 2017-03-06 21:10:40 +00:00
FileCheck [FileCheck] Added --enable-var-scope option to enable scope for regex variables. 2017-03-09 17:59:04 +00:00
Instrumentation [msan] Handle x86_sse_stmxcsr and x86_sse_ldmxcsr. 2017-03-03 01:12:43 +00:00
Integer
JitListener
LibDriver
Linker
LTO Perform symbol binding for .symver versioned symbols 2017-03-09 00:19:49 +00:00
MC [Assembler] Add location info to unary expressions. 2017-03-10 13:08:20 +00:00
Object
ObjectYAML [ObjectYAML] Fix issue with DWARF2 AddrSize 8 2017-03-07 21:34:35 +00:00
Other Fix crash when multiple raw_fd_ostreams to stdout are created. 2017-03-13 14:45:06 +00:00
SymbolRewriter
TableGen
ThinLTO/X86 LTO: Hash type identifier resolutions for WholeProgramDevirt. 2017-03-10 21:37:10 +00:00
tools [PGO] Refactor profile dumping function for ease of adding other profile kind 2017-03-09 19:03:57 +00:00
Transforms Use a WeakVH for UnknownInstructions in AliasSetTracker 2017-03-11 01:15:48 +00:00
Unit
Verifier [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg
lit.site.cfg.in
TestRunner.sh