summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2010-07-22 02:05:10 +0000
committerLang Hames <lhames@gmail.com>2010-07-22 02:05:10 +0000
commit624e0b2be6a8db6187206090ee5bc8f24cf55cb7 (patch)
tree6934dbd3986645d70fef75c2565e8f1e69d1e55f /include/llvm/CodeGen
parent2d4590d6fbb21911e7bff8a4f1bdddd76edbebe0 (diff)
downloadllvm-624e0b2be6a8db6187206090ee5bc8f24cf55cb7.tar.gz
llvm-624e0b2be6a8db6187206090ee5bc8f24cf55cb7.tar.bz2
llvm-624e0b2be6a8db6187206090ee5bc8f24cf55cb7.tar.xz
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
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/LiveInterval.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index 8d80efbc5c..a0aea23c99 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -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());
}