diff options
author | Greg Clayton <gclayton@apple.com> | 2017-05-04 18:29:44 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2017-05-04 18:29:44 +0000 |
commit | 48ff66a28098afd7c3bd593adb45a8d8d32a4857 (patch) | |
tree | 17822725886d29c0d44d45e31d3911c32816d992 /llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | |
parent | 6d2ea6ec809d7c648c7b31ae195753b5507e7169 (diff) | |
download | bcm5719-llvm-48ff66a28098afd7c3bd593adb45a8d8d32a4857.tar.gz bcm5719-llvm-48ff66a28098afd7c3bd593adb45a8d8d32a4857.zip |
Don't return an invalid line table if the DW_AT_stmt_list value is not in the .debug_line section.
llvm-svn: 302180
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFContext.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index 573d37d77fe..179d6afa579 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -692,6 +692,10 @@ DWARFContext::getLineTableForUnit(DWARFUnit *U) { if (const DWARFLineTable *lt = Line->getLineTable(stmtOffset)) return lt; + // Make sure the offset is good before we try to parse. + if (stmtOffset >= U->getLineSection().size()) + return nullptr; + // We have to parse it first. DataExtractor lineData(U->getLineSection(), isLittleEndian(), U->getAddressByteSize()); |