summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCObjectStreamer.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-12-17 21:49:35 +0000
committerReid Kleckner <rnk@google.com>2018-12-17 21:49:35 +0000
commit94ee0728e5e8665821ecfc20c2441e4bfc4e0bf2 (patch)
tree3603350ed670e605c4bf3d3922de8588b773149c /llvm/lib/MC/MCObjectStreamer.cpp
parentb85b15d64acb303a56a79ad514d24d46fbe12612 (diff)
downloadbcm5719-llvm-94ee0728e5e8665821ecfc20c2441e4bfc4e0bf2.tar.gz
bcm5719-llvm-94ee0728e5e8665821ecfc20c2441e4bfc4e0bf2.zip
[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
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp6
1 files changed, 5 insertions, 1 deletions
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<std::pair<const MCSymbol *, const MCSymbol *>> 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);
}
OpenPOWER on IntegriCloud