summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
diff options
context:
space:
mode:
authorVictor Leschuk <vleschuk@accesssoftek.com>2017-02-25 13:15:57 +0000
committerVictor Leschuk <vleschuk@accesssoftek.com>2017-02-25 13:15:57 +0000
commit96d9981ec67e1076ce2aa512afb2ca55beb64026 (patch)
tree0dec515595191f8daefa6fcefb2c3004b6a6f67e /llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
parentbeabf456df875f0b0d11cb5784bc479e976390fc (diff)
downloadbcm5719-llvm-96d9981ec67e1076ce2aa512afb2ca55beb64026.tar.gz
bcm5719-llvm-96d9981ec67e1076ce2aa512afb2ca55beb64026.zip
[DebugInfo] Skip implicit_const attributes when dumping .debug_info. NFC.
When dumping .debug_info section we loop through all attributes mentioned in .debug_abbrev section and dump values using DWARFFormValue::extractValue(). We need to skip implicit_const attributes here as their values are not really located in .debug_info but directly in .debug_abbrev. This patch fixes triggered assert() in DWARFFormValue::extractValue() caused by trying to access implicit_const values from .debug_info. llvm-svn: 296253
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDie.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFDie.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
index 6949366323b..bdeff7bd3af 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -329,6 +329,12 @@ void DWARFDie::dump(raw_ostream &OS, unsigned RecurseDepth,
// Dump all data in the DIE for the attributes.
for (const auto &AttrSpec : AbbrevDecl->attributes()) {
+ if (AttrSpec.Form == DW_FORM_implicit_const) {
+ // We are dumping .debug_info section ,
+ // implicit_const attribute values are not really stored here,
+ // but in .debug_abbrev section. So we just skip such attrs.
+ continue;
+ }
dumpAttribute(OS, *this, &offset, AttrSpec.Attr, AttrSpec.Form,
Indent);
}
OpenPOWER on IntegriCloud