Skip to content

Commit bc847b3

Browse files
committed
[cc1as] Close MCAsmParser before MCStreamer
This is a pre-existing problem exposed by D90511 (asan failurs with clang/test/Driver/relax.s and a few other tests).
1 parent b68994b commit bc847b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/tools/driver/cc1as_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
520520
Failed = Parser->Run(Opts.NoInitialTextSection);
521521
}
522522

523-
// Close Streamer first.
524-
// It might have a reference to the output stream.
523+
// Parser has a reference to the output stream (Str), so close Parser first.
524+
Parser.reset();
525525
Str.reset();
526526
// Close the output stream early.
527527
BOS.reset();

0 commit comments

Comments
 (0)