Don't return an invalid line table if the DW_AT_stmt_list value is not in the .debug_line section.
llvm-svn: 302180
This commit is contained in:
parent
6d2ea6ec80
commit
48ff66a280
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue