From 624e0b2be6a8db6187206090ee5bc8f24cf55cb7 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 22 Jul 2010 02:05:10 +0000 Subject: [PATCH] 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 --- include/llvm/CodeGen/LiveInterval.h | 2 ++ 1 file changed, 2 insertions(+) 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()); } -- 2.34.1