summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCFragment.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-12-05 10:43:58 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-12-05 10:43:58 +0000
commit79ace92fcd19c357d51a414109fb1121014c0173 (patch)
tree48871d86a77ec5beca99c974a5f56bd3f7f4e78b /llvm/lib/MC/MCFragment.cpp
parentd24730cdda57d76f980980085a17b041edc0df35 (diff)
downloadbcm5719-llvm-79ace92fcd19c357d51a414109fb1121014c0173.tar.gz
bcm5719-llvm-79ace92fcd19c357d51a414109fb1121014c0173.zip
Recommit r348243 - "[llvm-mc] - Do not crash when referencing undefined debug sections."
The patch triggered an unrelated msan issue: LayoutOrder variable was not initialized. (http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/26794/steps/check-llvm%20msan/logs/stdio) It was fixed. Original commit message: MC has code that pre-creates few debug sections: https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCObjectFileInfo.cpp#L396 If users code has a reference to such section but does not redefine it, MC code currently asserts, because still thinks they are normally defined. The patch fixes the issue. Differential revision: https://reviews.llvm.org/D55173 ---- Modified : /llvm/trunk/lib/MC/ELFObjectWriter.cpp Added : /llvm/trunk/test/MC/ELF/undefined-debug.s llvm-svn: 348349
Diffstat (limited to 'llvm/lib/MC/MCFragment.cpp')
-rw-r--r--llvm/lib/MC/MCFragment.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCFragment.cpp b/llvm/lib/MC/MCFragment.cpp
index 0ebcf21a422..f2e08184c72 100644
--- a/llvm/lib/MC/MCFragment.cpp
+++ b/llvm/lib/MC/MCFragment.cpp
@@ -238,7 +238,7 @@ MCFragment::~MCFragment() = default;
MCFragment::MCFragment(FragmentType Kind, bool HasInstructions,
MCSection *Parent)
: Kind(Kind), HasInstructions(HasInstructions), Parent(Parent),
- Atom(nullptr), Offset(~UINT64_C(0)) {
+ Atom(nullptr), Offset(~UINT64_C(0)), LayoutOrder(0) {
if (Parent && !isDummy())
Parent->getFragmentList().push_back(this);
}
OpenPOWER on IntegriCloud