summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2019-12-20 15:13:29 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2020-01-03 12:35:32 +0000
commit418cd8216b41f4c08e0e1b22feda381d9b2345da (patch)
tree9b022031110efc8d181a8ce846c29de0553759f4 /llvm/lib/DebugInfo
parente456165f9fec9148566849f21bc4f7dda2fea034 (diff)
downloadbcm5719-llvm-418cd8216b41f4c08e0e1b22feda381d9b2345da.tar.gz
bcm5719-llvm-418cd8216b41f4c08e0e1b22feda381d9b2345da.zip
[DebugInfo] Remove redundant checks for past-the-end of prologue
The V5 directory and filename tables had checks in to make sure we hadn't read past the end of the line table prologue. Since previous changes to the data extractor class ensure we never read past the end, these checks are now redundant, so this patch removes them. There is still a check to show that the whole prologue remains within the prologue length. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D71768
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
index 8892739d55f..5c86858f31a 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -196,14 +196,6 @@ parseV5EntryFormat(const DWARFDataExtractor &DebugLineData, uint64_t *OffsetPtr,
int FormatCount = DebugLineData.getU8(OffsetPtr);
bool HasPath = false;
for (int I = 0; I != FormatCount; ++I) {
- if (*OffsetPtr >= EndPrologueOffset)
- return createStringError(
- errc::invalid_argument,
- "failed to parse entry content descriptions at offset "
- "0x%8.8" PRIx64
- " because offset extends beyond the prologue end at offset "
- "0x%8.8" PRIx64,
- *OffsetPtr, EndPrologueOffset);
ContentDescriptor Descriptor;
Descriptor.Type =
dwarf::LineNumberEntryFormat(DebugLineData.getULEB128(OffsetPtr));
@@ -239,14 +231,6 @@ parseV5DirFileTables(const DWARFDataExtractor &DebugLineData,
// Get the directory entries, according to the format described above.
int DirEntryCount = DebugLineData.getU8(OffsetPtr);
for (int I = 0; I != DirEntryCount; ++I) {
- if (*OffsetPtr >= EndPrologueOffset)
- return createStringError(
- errc::invalid_argument,
- "failed to parse directory entry at offset "
- "0x%8.8" PRIx64
- " because offset extends beyond the prologue end at offset "
- "0x%8.8" PRIx64,
- *OffsetPtr, EndPrologueOffset);
for (auto Descriptor : *DirDescriptors) {
DWARFFormValue Value(Descriptor.Form);
switch (Descriptor.Type) {
@@ -275,14 +259,6 @@ parseV5DirFileTables(const DWARFDataExtractor &DebugLineData,
// Get the file entries, according to the format described above.
int FileEntryCount = DebugLineData.getU8(OffsetPtr);
for (int I = 0; I != FileEntryCount; ++I) {
- if (*OffsetPtr >= EndPrologueOffset)
- return createStringError(
- errc::invalid_argument,
- "failed to parse file entry at offset "
- "0x%8.8" PRIx64
- " because offset extends beyond the prologue end at offset "
- "0x%8.8" PRIx64,
- *OffsetPtr, EndPrologueOffset);
DWARFDebugLine::FileNameEntry FileEntry;
for (auto Descriptor : *FileDescriptors) {
DWARFFormValue Value(Descriptor.Form);
OpenPOWER on IntegriCloud