projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d2ea6e
)
Don't return an invalid line table if the DW_AT_stmt_list value is not in the .debug_...
author
Greg Clayton
<gclayton@apple.com>
Thu, 4 May 2017 18:29:44 +0000
(18:29 +0000)
committer
Greg Clayton
<gclayton@apple.com>
Thu, 4 May 2017 18:29:44 +0000
(18:29 +0000)
llvm-svn: 302180
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index
573d37d
..
179d6af
100644
(file)
--- 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());