summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
diff options
context:
space:
mode:
authorVlad Tsyrklevich <vlad@tsyrklevich.net>2019-03-02 01:10:00 +0000
committerVlad Tsyrklevich <vlad@tsyrklevich.net>2019-03-02 01:10:00 +0000
commit53a9f1d3676c21b274065bfe1665a0fdcf2bdf24 (patch)
treecf7ef365d268029e2527a5bac07ad340ba943ec6 /llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
parent7ec62fde78cd6199738e46c3db044e0d0aac2d89 (diff)
downloadbcm5719-llvm-53a9f1d3676c21b274065bfe1665a0fdcf2bdf24.tar.gz
bcm5719-llvm-53a9f1d3676c21b274065bfe1665a0fdcf2bdf24.zip
Revert "[DWARFFormValue] Cleanup DWARFFormValue interface. (2/2) (NFC)"
This reverts commit r355233, it was causing UBSan failures. llvm-svn: 355255
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
index 8dbca510d15..a2c25248618 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -212,14 +212,15 @@ parseV5DirFileTables(const DWARFDataExtractor &DebugLineData,
if (*OffsetPtr >= EndPrologueOffset)
return false;
for (auto Descriptor : DirDescriptors) {
+ DWARFFormValue Value(Descriptor.Form);
switch (Descriptor.Type) {
case DW_LNCT_path:
- IncludeDirectories.push_back(DWARFFormValue::createFromData(
- Descriptor.Form, FormParams, *U, DebugLineData, OffsetPtr, &Ctx));
+ if (!Value.extractValue(DebugLineData, OffsetPtr, FormParams, &Ctx, U))
+ return false;
+ IncludeDirectories.push_back(Value);
break;
default:
- if (!DWARFFormValue::skipValue(Descriptor.Form, DebugLineData,
- OffsetPtr, FormParams))
+ if (!Value.skipValue(DebugLineData, OffsetPtr, FormParams))
return false;
}
}
@@ -239,8 +240,9 @@ parseV5DirFileTables(const DWARFDataExtractor &DebugLineData,
return false;
DWARFDebugLine::FileNameEntry FileEntry;
for (auto Descriptor : FileDescriptors) {
- DWARFFormValue Value = DWARFFormValue::createFromData(
- Descriptor.Form, FormParams, *U, DebugLineData, OffsetPtr, &Ctx);
+ DWARFFormValue Value(Descriptor.Form);
+ if (!Value.extractValue(DebugLineData, OffsetPtr, FormParams, &Ctx, U))
+ return false;
switch (Descriptor.Type) {
case DW_LNCT_path:
FileEntry.Name = Value;
OpenPOWER on IntegriCloud