From 94ee0728e5e8665821ecfc20c2441e4bfc4e0bf2 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 17 Dec 2018 21:49:35 +0000 Subject: [codeview] Flush labels before S_DEFRANGE* fragments This was a pre-existing bug that could be triggered with assembly like this: .p2align 2 .LtmpN: .cv_def_range "..." I noticed this when attempting to change clang to emit aligned symbol records. llvm-svn: 349403 --- llvm/lib/MC/MCObjectStreamer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/MC/MCObjectStreamer.cpp') diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp index 248c5a1fe35..6ec705bdddb 100644 --- a/llvm/lib/MC/MCObjectStreamer.cpp +++ b/llvm/lib/MC/MCObjectStreamer.cpp @@ -497,7 +497,11 @@ void MCObjectStreamer::EmitCVInlineLinetableDirective( void MCObjectStreamer::EmitCVDefRangeDirective( ArrayRef> Ranges, StringRef FixedSizePortion) { - getContext().getCVContext().emitDefRange(*this, Ranges, FixedSizePortion); + MCFragment *Frag = + getContext().getCVContext().emitDefRange(*this, Ranges, FixedSizePortion); + // Attach labels that were pending before we created the defrange fragment to + // the beginning of the new fragment. + flushPendingLabels(Frag, 0); this->MCStreamer::EmitCVDefRangeDirective(Ranges, FixedSizePortion); } -- cgit v1.2.3