forked from OSchip/llvm-project
Fix the cc1as crash when it outputs assembly
In clang cc1as_main, when the output file type is “asm”, AsmStreamer owns a formatted_raw_ostream which has a reference to FDOS (raw_ostream), so AsmStreamer must be closed before FDOS is closed. llvm-svn: 243085
This commit is contained in:
parent
57776b8159
commit
ae480ecaec
|
@ -0,0 +1,3 @@
|
|||
// Run cc1as asm output path just to make sure it works
|
||||
// REQUIRES: x86-registered-target
|
||||
// RUN: %clang -cc1as -triple x86_64-apple-macosx10.10.0 -filetype asm %s -o /dev/null
|
|
@ -406,6 +406,9 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
|
|||
Failed = Parser->Run(Opts.NoInitialTextSection);
|
||||
}
|
||||
|
||||
// Close Streamer first.
|
||||
// It might have a reference to the output stream.
|
||||
Str.reset();
|
||||
// Close the output stream early.
|
||||
BOS.reset();
|
||||
FDOS.reset();
|
||||
|
|
Loading…
Reference in New Issue