From: Lang Hames Date: Thu, 22 Jul 2010 02:05:10 +0000 (+0000) Subject: If 'other' was empty 'overlapsFrom(other, other.begin());' will segfault. This avoids... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=624e0b2be6a8db6187206090ee5bc8f24cf55cb7;p=oota-llvm.git 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 --- diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index 8d80efbc5c7..a0aea23c994 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()); }