[test] Fix TestDWARFDieRangeInfoIntersects

Fixes heap buffer overflow triggered in DWARF verifier, detected by ASAN.

llvm-svn: 313280
This commit is contained in:
Jonas Devlieghere 2017-09-14 17:46:23 +00:00
parent defe371771
commit d585a20394
1 changed files with 2 additions and 0 deletions

View File

@ -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) {