summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2017-09-14 17:46:23 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2017-09-14 17:46:23 +0000
commitd585a20394704bc7812489fc7a6af8136589c465 (patch)
tree2a26bf5d793faf46e5a53a8427dd3d104b55d9cc /llvm/lib
parentdefe37177166ffaf14553f402ad4a0ea5971aa53 (diff)
downloadbcm5719-llvm-d585a20394704bc7812489fc7a6af8136589c465.tar.gz
bcm5719-llvm-d585a20394704bc7812489fc7a6af8136589c465.zip
[test] Fix TestDWARFDieRangeInfoIntersects
Fixes heap buffer overflow triggered in DWARF verifier, detected by ASAN. llvm-svn: 313280
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 04530c44d87..24a0e67b003 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -89,6 +89,8 @@ bool DWARFVerifier::DieRangeInfo::intersects(const DieRangeInfo &RHS) const {
auto End = Ranges.end();
auto Iter = findRange(RHS.Ranges.front());
for (const auto &R : RHS.Ranges) {
+ if(Iter == End)
+ return false;
if (R.HighPC <= Iter->LowPC)
continue;
while (Iter != End) {
OpenPOWER on IntegriCloud