mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-11 05:35:11 +00:00
Don't return an invalid line table if the DW_AT_stmt_list value is not in the .debug_line section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302180 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
984dc047e7
commit
b1cbece412
@ -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
Block a user