OSDN Git Service

If 'other' was empty 'overlapsFrom(other, other.begin());' will segfault. This avoids...
authorLang Hames <lhames@gmail.com>
Thu, 22 Jul 2010 02:05:10 +0000 (02:05 +0000)
committerLang Hames <lhames@gmail.com>
Thu, 22 Jul 2010 02:05:10 +0000 (02:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109075 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LiveInterval.h

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