diff options
author | Lang Hames <lhames@gmail.com> | 2010-07-22 02:05:10 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2010-07-22 02:05:10 +0000 |
commit | 624e0b2be6a8db6187206090ee5bc8f24cf55cb7 (patch) | |
tree | 6934dbd3986645d70fef75c2565e8f1e69d1e55f /include/llvm/CodeGen | |
parent | 2d4590d6fbb21911e7bff8a4f1bdddd76edbebe0 (diff) | |
download | llvm-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.h | 2 |
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()); } |