If 'other' was empty 'overlapsFrom(other, other.begin());' will segfault. This avoids that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lang Hames 2010-07-22 02:05:10 +00:00
parent 2d4590d6fb
commit 624e0b2be6

View File

@ -465,6 +465,8 @@ namespace llvm {
/// overlaps - Return true if the intersection of the two live intervals is /// overlaps - Return true if the intersection of the two live intervals is
/// not empty. /// not empty.
bool overlaps(const LiveInterval& other) const { bool overlaps(const LiveInterval& other) const {
if (other.empty())
return false;
return overlapsFrom(other, other.begin()); return overlapsFrom(other, other.begin());
} }